![]() |
How to do automatic action in the teleop?
Hello :)
I'm trying to implement that when I'm press a button on the joystick the robot starting an automatic actions (in the teleop periodic)... for example when pressing a button 3 it will called a custom method: Code:
if(stick.getRawButton(3)){Any ideas? |
Re: How to do automatic action in the teleop?
Sure. Your autonomous action should be implemented using a state machine. The state machine should have a START state and a DONE state. In your teleop periodic, you check for a button and then start the state machine. You also add a statement to execute the state machine in your teleop periodic code. Something like this (this is pseudocode so it is not syntactically correct):
Code:
private int autoActionState = 0; // 0 is the DONE state. |
| All times are GMT -5. The time now is 08:59 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi