You are viewing our Forum Archives. To view or take place in current topics click here.
easyC v4 button switch help
Posted:

easyC v4 button switch helpPosted:

wakwakman
  • New Member
Status: Offline
Joined: May 05, 201212Year Member
Posts: 30
Reputation Power: 1
Status: Offline
Joined: May 05, 201212Year Member
Posts: 30
Reputation Power: 1
Hi, currently in my robotics class we are building vex robots to compete against each other. One of the things we want to do is have a button on the back of the robot that, when pressed, will disable function of the robot for 3 seconds. My teacher is not experienced in programming so has called upon me and a few other guys. I am not at school right now, so i cant give the exact code, but i can provide a general overview of what we have so far.

While(1==1){
Button = GetDataInput from button
If (Button == 1){ // 1 = not pressed
Code for motors...
}else{
Wait(3000)
}

Running this code, the button will only pause if it is pressed while the motors are not running. If we are running the motors while the button is pressed, the motors still continue to run. How can i make it so even if the moors are running, right when the button is pressed, the morors will stop for three seconds?
#2. Posted:
XboxLlVE
  • Wise One
Status: Offline
Joined: Dec 19, 201310Year Member
Posts: 541
Reputation Power: 23
Status: Offline
Joined: Dec 19, 201310Year Member
Posts: 541
Reputation Power: 23
Ive been trying to learn these myself.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.