Week 03 - lglik/Portfolio GitHub Wiki
Week Three
9/4/18 - 9/7/18
Monday:
Labor Day
Tuesday:
During the past week, it was discovered that there wasn't any way for Kivy to detect joystick input. To solve this, I learned how to use PyGame. I imported PyGame into the existing python file and had PyGame detect and accept the input from the joysticks. I mapped the axis of the joystick to control the movement of the paddles where horizontal joystick movement controls the left paddle, and vertical joystick movement controls the right paddle. Later, I wrote code to detect how many joysticks are connected to the computer, and if there are two, change the controls, so each joystick controls one paddle. I also added a "cheat" where if the trigger button is held down, the joystick controls the ball movement instead.
Wednesday:
After learning a lot about Kivy, Python, PyGame, Pis, and GUIs, the group started to transition to getting hardware set up to practice our programming our skills. I worked to assemble a Raspberry Pi configuration where it would be attached to an RPiMIB (Raspberry Pi Multi-Interface Board) and a SlushEngine. The first thing we wanted to hookup to the Pi was the robotic arm. I spent some time looking through the code to determine which ports on the Pi should connect to which parts of the arm. There were three sets of ports, S ports on the RPiMIB, Motor ports, and P ports on the SlushEngine breakout board. I identified the ports and found connectors, and extension cords as well as modifying a lot of the connectors.
Thursday:
I continued to work on the robotic arm and also learned how to crimp wires. The wires needed to be crimped in order to be put into power pulls, rectangular pieces of plastic that latch onto eachother. I also learned how to have the wires branch and how to twist them using a drill. I continued to work on setting up the robotic arm and eventually finished the hardware for it. The existing code would run and bring up a GUI however the robotic arm could only be controlled manually. Aditionally, the sensors were not sending information back to the Pi and the motor could not home. I worked for a while on understanding the code and thinking about how to adress these issues.
Friday:
I began work on the Perpetual Motion Machine. The setup with Pi was quite similar, however, the other hardware was quite different. Again, I looked through the code to determine the correct ports and changed some code to better work with the Pi configuration. Through this process I learned a lot about the interface between hardware and software, how power is distributed through electronics, and much about how to connect motors, sensors, servos, and neumatics. I was eventually able to finish setting up the machine, however, the code for the machine would make the somputer completely freeze. Becuase of this, I learned the command crtl+alt+sysreq+r+e+i+s+u+b. While a very long "shortcut," it is useful for forcing a Pi to reboot.