55
4-7-
3 Installation of Receiving Head
2
、
open the "Lesson\Module_Test\PS2X_Test\PS2X_Test.ino" in the supporting courseware Finally,
download the program to the development board of Arduino and open the PS2 remote control. If the
receiving head is connected to the remote control (or the pairing is successful), the indicator light on the
receiving head is long, and vice versa, the LED light flashes continuously. Finally, we open the "serial
monitor", press any button on the remote control, you can see the corresponding data on the "serial monitor",
as shown in Figure 4-7-4.
Figure 4-7-
4 “Serial Monitor” data display
4.7.3 Software Design
Ps2 Control program in
“
Lesson\Comprehensive Experiment\PantherTank_PS2X\PantherTank_PS2X
.ino”
In above programs,we just finished the experiment of testing the button. In this experiment we want to
implement the PS2 remote control car function. We first define all the button functions as follows: