Thread: Check My Code
View Single Post
  #3   Spotlight this post!  
Unread 18-03-2011, 23:18
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Check My Code

Quote:
Originally Posted by Alan Anderson View Post
I have three quick comments.

First, you don't need to use that "At T" local variable. You can just wire the value out of the first while loop into the beginning of your flat sequence. That way, the sequence will not run until the line-following loop ends and provides a value.

Second, it's really easy to have a relay hold a value for a certain amount of time. Since relays don't have motor safeties to shut them down if you don't keep setting them every so often, just put the Relay Set and a Wait function next to each other in the sequence frame. That frame will not finish until the Wait time has elapsed, and you can put another Relay Set in the next frame to turn it off.

Finally, the motor safeties make it not so easy to do the same thing for your drive motors. You can turn off the safety and try it that way, or you can try to adapt something Greg McKaskle posted a while back.
Hey Alan,
Thanks for the help. I went with your advice of disabling the drive safety and putting wait functions in. I didn't really want to use greg's method as great as it is, because it would have gotten pretty confusing for me, and the other method seemed simplier in my mind. I have attached my new version, if you can just take a glance at it. Thanks again.

Jared
Attached Files
File Type: vi Arcade Drive Autnomous with correct timing.vi (27.4 KB, 16 views)
Reply With Quote