Week 33 - lglik/Portfolio GitHub Wiki

04/29/19 - 05/03/19

Day One:

I finished up the electrical panel for the Rube Goldberg Vending Machine project for the most part. They key switch had not been made or installed yet so I just bypassed the key switch and connected the power supply directly to the power strip. This is fine since everything will be powered and I can work on developing the code for the project. I ran into an issue when I tried to boot up the Pi. It turns out that whatever old image was still in the pi was completely broken and would not boot. This was not really an issue in the end since I needed a new image anyways. I got a new image and then took it over to a surface tablet and a pi. The surface tablet allows the user to initialize an image. The idea is that the initialization process allows each person to pick and then install all of the libraries they need for their project quickly and easily. It also standardizes the location of the libraries on each pi. I followed the instructions I wrote at the beginning of the year to set up ssh communications between my tablet and the new pi. I also setup PyCharm to use the version of python on the Pi and run it there. I also installed the serial master library that will allow the Pi to control the Arduino.

Day Two:

I downloaded the Arduino IDE and used the Serialmaster library to set up some code to upload to the Arduino to make is slaved to the Pi. I was successfully able to get the Arduino to echo back messages through the Pi. I tried to figure out how to connect to the ports on the stepper shield next. The sensor ports were very easy since the port on the Arduino board they were connected to was printed next to them. However, the stepper ports did not have any info written next to them and were hooked up to multiple Arduino ports. I hooked up a limit switch to one of the sensor ports and then wrote code that would execute on the Pi and would read the sensor input on the Arduino. I was able to correctly read the sensor inputs and have the Pi output the state of a limit switch. I realized that in order to use the stepper motors I would need to know which pins on the Arduino are connected to the enable, direction, and step pins. I pulled up the schematics for the stepper shield and for the Arduino and mapped out all the pins for each of the six stepper motor ports.

Day Three:

I learned from Mr. Harlow that there was already a library for using Stepper motors with the Arduino Mega. He pointed out that although the library was made for a different shield, it is quite likely that the shield I have was designed to be compatible with this library and use the same ports. Using the ports I documented yesterday, I was able to confirm that the library would work with my hardware. I installed the library and then was able to use it control a stepper motor. I then wrote some code that would allow a call to "release gumballs" from the Pi cause the Arduino to have the stepper execute a series of actions. When I came back later in the day, I kept getting an issue where PyCharm said that it was the Arduino did not have an "echo" function. I was eventually able to figure out that this error was cauased by the initilization output failing due to the pi not being able to connect to the Arduino.

Tried switching out many things.

Day Four:

Spent day switching out more things. helped out with the ball wall.

Day Five:

Used logic analyzer. Crimped new cables. Arduino sending and receiving correctly. Serial communication chip on MIB passing on correct signal to Pi. Pi not detecting any signal.