View Single Post
  #9   Spotlight this post!  
Unread 01-03-2012, 21:10
NeatNit's Avatar
NeatNit NeatNit is offline
Alumni Programmer
FRC #1577 (Steampunk)
Team Role: Teacher
 
Join Date: Sep 2011
Rookie Year: 2011
Location: Israel
Posts: 60
NeatNit is an unknown quantity at this point
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.
Reply With Quote