|
Re: Solenoid not working in autonomous
This is happening because you are giving the solenoid a command. 100 times a second you tell it to be Forward inside Periodic. in Autonomous you tell it to go to Reverse, but then less than 1/100 of a second after that you tell it again in Periodic to go Forward, so it never had a chance to move.
You have to realize that Periodic Tasks runs all the time, even during Autonomous. Use Teleop.vi for your teleop needs, not Periodic.
A common way to update motors/actuators is to write to a global variable inside teleop or autonomous, and then read from that global variable in Periodic and update the motor accordingly.
|