DIP Switches
A DIP switch (the small switches on your board, can be used to configure different starting configurations for your robot.
An example of how to use the DIP switch is below:
byte selectedValue = 0x0;
//create a binary number by setting each bit
if(sumo.IsDIP1On()){
bitSet(selectedValue,0);
}
if(sumo.IsDIP2On()){
bitSet(selectedValue,1);
}
if(sumo.IsDIP3On()){
bitSet(selectedValue,2);
}
//Now we can check the value of the number
//create your own starting functions
if(selectedValue == 0){
runOption0();
}
else if(selectedValue == 1){
runOption1();
}
Last updated