Pros coding pneumatics

I am a first time coder and trying to add my pros into my code but I don’t know how. I feel like I have already tried everything I could find online. If you know how to code in pneumatics in pros please let me know how.

so why are you using PROS ?

4 Likes

I meant first time using pros becasue I used to do block but have to use pros now.

For pros 3.8.0 (older version): ADI (TriPort) C++ API — PROS for V5 3.8.0 documentation

pros::ADIAnalogOut claw_pneumatic = pros::ADIAnalogOut('A'); // Create a pneumatic in port A

void main()
{
    claw_pneumatic.set_value(true); // Extend
    claw_pneumatic.set_value(false); // Retract
}

For pros 4.1.0 (newest version): pros::adi::Pneumatics class | PROS for V5

pros::adi::Pneumatics claw_pneumatic = pros::adi::Pneumatics('A'); // Create a pneumatic in port A

void main()
{
    claw_pneumatic.set_value(true); // Extend
    claw_pneumatic.set_value(false); // Retract
    // OR
    claw_pneumatic.extend();
    claw_pneumatic.retract();

    claw_pneumatic.toggle(); // toggle the pneumatic
    claw_pneumatic.get_value(); // get it's current state
}
4 Likes

This is what I have tried can you tell if there’s something wrong that I can fix.

you haven’t been very descriptive of what you actually need, nobody can help you if we don’t know what you want. Do you want to extend the pneumatics once? Have it toggle on a button press? Something else?

Also, what I sent is just a list of everything you can do with the pneumatics, not something you can copy/paste in to make it magically work. If you want to extend the pneumatics, you only put in the extend line, or to make it retract you only put in the retract line, etc. The top line is the definition of the pneumatics, so you put that wherever you made motors and other devices

Thanks for the help we found it

I’m on her team and we did coding before and robotics and we needed to use pros we just don’t know how to code pneumatics

It needs to be used multiple times in a game