Wednesday, April 10, 2019

AM-90mins-Arduino code receiving wireless controller input and servo moving!

April 10, 2019
Break through! Today, we made large strides in our Robo Car project. For one, we got the code to recognize the PS2 wireless controller. The issue last time may have stemmed from the disconnecting wires. This was easily solved with some electrical tape. Once we pressed all the buttons to make sure the code recognized them all, we began adding some servo code to it. Since we didn't remember all the servo code for Arduino, we refreshed our knowledge with the GitHub servo code for Arduino. We first tried to connect up the servo through the servo motor driver. However, none of us could remember how to connect it up to the Arduino, so we simply connected the servo directly to the Arduino. We will figure out how to connect up the servo motor driver to the Arduino later on. Since we only had one servo to test with the code, we wrote in that the servo would move to position 100 when the left button was pushed and to position 30 when the right button was pushed. We got servo to move!!! During the build, the PS2 wireless controller died. Since we replaced the batteries last time, we realized that we were leaving the controller on for an extended period of time. In turn, we started to turn off the controller when we did not need to use it to get output data.

Next time:

  • Connecting Arduino up to Donkey Car
  • Connect up the servo motor driver so we can have more servos connected
  • Connect up Arduino to Donkey Car motors
  • Research about integrating code with Donkey Car
  • Convert C++ to Python?
  • Design and 3D print camera mount
  • Controlling Donkey Car with the PS2 controller

Friday, April 5, 2019

AM- 1 hr 30 min- Deciphering PS2 C++ code...

April 5, 2019

This is what we did today:
Today, we tried out the Arduino code from last time. It took us a while to get back to where we were because we forgot which wires went to which pins. Once we got it, the light would blink and when it connected to the controller, it would not blink. However, Benny found a better code by watching a helpful YouTube video. In the description, the person links you to their website where you can get the PS2 library and the example code. The example code provided much more results than the other one. In regards to how far we got, the Serial Monitor prints "Unknown  Controller," which is an issue because it should print "Dual Shock Controller," or have similar results to the controller in the video because they are the same. Most of the time, we spent trying to debug the "Unknown Controller" problem.

Next Steps:

  • Figure out how to get the program to recognize the controller
  • Have the program read the inputs
  • Design/Mount the camera to the Donkey Car