Keywish Hummer-Bot-2.0 Instruction Manual page 107

Table of Contents

Advertisement

switch(type) {
case
0:
Serial.println("Unknown Controller type found
break;
case
1:
Serial.println("DualShock Controller found
break;
case
2:
Serial.println("GuitarHero Controller found
break;
case
3:
Serial.println("Wireless Sony DualShock Controller found
break;
}
}
void
loop() {
/* You must Read Gamepad to get new values and set vibration values
ps2x.read_gamepad(small motor on/off, larger motor strenght from 0-255)
if you don't enable the rumble, use ps2x.read_gamepad(); with no values
You should call this at least once a second
*/
if(error
== 1){
resetFunc();
}
if(type
== 2){
//Guitar Hero Controller
ps2x.read_gamepad();
if(ps2x.ButtonPressed(GREEN_FRET))
Serial.println("Green Fret
if(ps2x.ButtonPressed(RED_FRET))
Serial.println("Red Fret
if(ps2x.ButtonPressed(YELLOW_FRET))
Serial.println("Yellow Fret
if(ps2x.ButtonPressed(BLUE_FRET))
Serial.println("Blue Fret
if(ps2x.ButtonPressed(ORANGE_FRET))
Serial.println("Orange Fret
if(ps2x.ButtonPressed(STAR_POWER))
Serial.println("Star Power
//skip loop if no controller found
//read controller
Pressed");
Pressed");
Pressed");
Pressed");
Pressed");
Command");
");
");
");
104
");

Advertisement

Table of Contents
loading

Related Products for Keywish Hummer-Bot-2.0

Table of Contents