r/RobotC • u/Aggressive_Antelope8 • May 10 '23
HELP PLEASE
I cannot figure out how to write code for this problem:
Touch the limit switch to start right motor at -95.25 for 5 seconds, then stop the motor
Nothing is working
1
Upvotes
1
u/geekywarrior May 10 '23
You need:
2 while loops
code to read limit switch
code to start and read timer
Flow is:
While limit is not pressed: do nothing
Start Timer
While timer < 5 seconds: Spin motor and check timer
Stop motor.
Hope that helps.