107
if
(
ps2x
.
Button
(
UP_STRUM
))
//will be TRUE as long as button is pressed
Serial
.
println
(
"Up Strum"
);
if
(
ps2x
.
Button
(
DOWN_STRUM
))
Serial
.
println
(
"DOWN Strum"
);
if
(
ps2x
.
Button
(
PSB_START
))
//will be TRUE as long as button is pressed
Serial
.
println
(
"Start is being held"
);
if
(
ps2x
.
Button
(
PSB_SELECT
))
Serial
.
println
(
"Select is being held"
);
if
(
ps2x
.
Button
(
ORANGE_FRET
))
{
// print stick value IF TRUE
Serial
.
(
"Wammy Bar Position:"
);
Serial
.
println
(
ps2x
.
Analog
(
WHAMMY_BAR
),
DEC
);
}
}
else
{
//DualShock Controller
ps2x
.
read_gamepad
(
false
,
vibrate
);
//read controller and set large motor to spin at
'vibrate' speed
if
(
ps2x
.
Button
(
PSB_START
))
//will be TRUE as long as button is pressed
Serial
.
println
(
"Start is being held"
);
if
(
ps2x
.
Button
(
PSB_SELECT
))
Serial
.
println
(
"Select is being held"
);
if
(
ps2x
.
Button
(
PSB_PAD_UP
))
{
//will be TRUE as long as button is pressed
Serial
.
(
"Up held this hard: "
);
Serial
.
println
(
ps2x
.
Analog
(
PSAB_PAD_UP
),
DEC
);
}
if
(
ps2x
.
Button
(
PSB_PAD_RIGHT
)){
Serial
.
(
"Right held this hard: "
);
Serial
.
println
(
ps2x
.
Analog
(
PSAB_PAD_RIGHT
),
DEC
);
}
if
(
ps2x
.
Button
(
PSB_PAD_LEFT
)){
Serial
.
(
"LEFT held this hard: "
);
Serial
.
println
(
ps2x
.
Analog
(
PSAB_PAD_LEFT
),
DEC
);
}
if
(
ps2x
.
Button
(
PSB_PAD_DOWN
)){
Serial
.
(
"DOWN held this hard: "
);
Serial
.
println
(
ps2x
.
Analog
(
PSAB_PAD_DOWN
),
DEC
);
}
Summary of Contents for Hummer-Bot-1.0
Page 1: ...Hummer Bot 1 0 Instruction Manual V 2 0 ...
Page 18: ...15 Step4 You need to install motors Figure 3 1 5 Schematic diagram of motor installation ...
Page 50: ...47 Figure 3 2 15 Diagram of Data without Obstacles ...
Page 83: ...80 Test code Path hummer bot Lesson ModuleDemo IrkeyPressed IrkeyPressed ino ...