How to run motors and solenoid in parallel in same command

I want to rev up my motors on my shooting mechanism then after then get to speed trigger my solenoid while they are still spinning. they are in the same command

A couple of different ways:

  1. If you want all those actions in the same command, you could do the following in the execute() method of the command:
    a) Check the current speed of the shooter motors. if it’s not up to speed yet, do nothing (this has the effect of continuing to run the motors)
    b) If they are up to speed, trigger the solenoid
    c) Might want to wait a little bit before you start to spin down the shooter motors

or, you could make multiple commands, and string them together in a command group
a) Have a command to spin up the shooters to speed (this will execute until the target speed is reached)
b) Have a command to actuate the solenoid
c) use addSequential() in command group to add them one after another

1 Like

Alternatively, you could have the initialize() set the shooter motors, isFinished() check if they are up to speed, and end() set the solenoids.

1 Like

Ooh that’s a good one!

1 Like