For the previous study of the project you may check it through the previous posts to check out more information. We are going to show how to control the camera car with a PS4 controller through Bluetooth signal in this post.
Before setting up for the Bluetooth, you should have a well assembled Intel Edison mini breakout board and framework updated. Please refer to here for an official instruction to do so.
The set up for Intel Edison to pair up with a Bluetooth device is relatively simple.
Run the following command to unblock Bluetooth for Edison:rfkill unblock bluetooth
bluetoothctl
Then type the following in the command line to register an agent and set it as default:agent KeyboardDisplay
default-agent
Scan for devices nearby by typing:scan on
You may be possible to see the connectable devices on the screen. Select the device ID you want to pair:pair<Device ID>
After the pairing process finish. You may connect the device by this command:connect<Device ID>
At last simply type the command:quit
to leave Bluetooth mode.
You may also go through the official guide of Bluetooth connection through the link here.
Before scanning for devices, you should switch on the pairing mode for the PS4 controller. The reason of choosing PS4 as the controller is it has a more open Bluetooth environment (Bluetooth 2.1), which makes it easier to be used on other devices and with a stronger connection. Press the SHARE button and PlayStation button simultaneously for a few seconds until you see the LED bar blinks quickly with a specific pattern. After the PS4 controller successfully connect to the Edison, you shall see the LED bar light up without flashing. And you may also confirm the connection from the screen.
In order to read values sent from the PS4 controller, we are using the evtest(https://cgit.freedesktop.org/~whot/evtest) utility mentioned in Intel’s Guide.
evtest displays information on the input device specified on the command line, including all the events supported by the device. It then monitors the device and displays all the events layer events generated.
With evtest you should now be able to read values sent from PS4 controller with the following command and see the output.
For the next post we are going to introduce the controlling method of the camera car with the analog stick on PS4 controller and the mechanism of the wheels movement.
コメントをするにはログインしてください。