Skip to content

Instantly share code, notes, and snippets.

View rajkundu's full-sized avatar

Raj Kundu rajkundu

View GitHub Profile
@rajkundu
rajkundu / toggleMode.c
Created April 26, 2018 03:05
Example of code to toggle between two modes on a robot in RobotC
bool myToggleEnabled = true;
//-------------------- Code for toggling between modes --------------------//
//Let's say you must press all 4 buttons on the back of the controller to switch modes.
if((vexRT[Btn5U] == 1)&&(vexRT[Btn5D] == 1)&&(vexRT[Btn6U] == 1)&&(vexRT[Btn6D] == 1))
{
while((vexRT[Btn5U] == 1)&&(vexRT[Btn5D] == 1)&&(vexRT[Btn6U] == 1)&&(vexRT[Btn6D] == 1))
{
//Wait for toggle buttons to be released