sample code to move robot autonomously

Hey Luke (or anybody out there) . Why doesn’t the default autonomous code work!!?? I did all the updates, re-iimaged the cRio, configured the camera but the i get no image!! Your code works. At least we got something happening here, but the image is a no show! Please help!

That code was a lot of help, thanks. Is it possible to press a button and have the same steps used for the autonomous kicking in teleop?

Glad it helped you.

The easiest way to use this code in teleop also is to make it a subvi. To do this, select all the code for the state machine (while loop included). Then, go to the “Edit” menu and select “Make SubVI”. LabVIEW with put the code in a new vi and automatically creat the inputs for you. Save this vi, then you can drop it in teleop to use it.

Note: for this to work, the state machine must stop the loop when it’s done. If you want to run the state machine in autonomous more then once, you can make another state machine which calls the sub state machine.

Luke i’m having some major problems…I make that autonomous example you attached as my autonomous independent and change the references to fit our drive style. But when i try to run the program i says disabled, enabled, and then watchdog not fed. This ‘watchdog not fed’ happens not matter what i change to the code, is there any hope for me?!?

I’m not sure what could be causing your problems, Sidney. The Autonomous Independent vi reference is set in Did you update it to point to the new vi? I don’t have access to a computer with LabVIEW right now. Worst case, use my vi as a reference and code it in your Autonomous Independent vi.

Hey Luke you were such great help, i am trying to incorporate the solenoid and compressor into my existing robot main program. can i maybe do like you said a couple of posts back and make it a sub vi and then just drop it into my autononmous and teleop vi?
thanks much for you help