Wednesday, December 10, 2014

Epiphany

After much waiting for help with the complicated I2C sketches (which Jonathan was unfortunately not able to decipher,) I had a godsend while waiting between classes. While trying to determine why "WriteByte" and "ReadByte" were being reported as not being defined within the scope of the sketch, I idly noticed that these two were not used in the primary for loops of the sensor's respective example sketches. I had originally included them within the main for loop of the combined sketch, placing them within the if statements that were run if the shield was on the sensor's respective port. After a quick glance between the sketches of the two sensors, I noticed the Read and Write functions were the same for both. Therefore, I pulled the read and write functions out of the for loop, placing them subsequent to it - and like that, the sketch was verified 100%, ending much misery and frustration.

However, a new problem arose: The IR sensor kept registering an object as being detected, regardless of whether anything was placed before it. After waiting some time for coding help (again,) I decided to begin troubleshooting the problem myself again. My first thought was to determine if there was something wrong with the shield's ports, so I swapped the ports each sensor was connected to, to see if the line sensor kept registering false data while the proximity sensor operated fine. Miraculously, swapping the ports somehow managed to make both devices work correctly!

Additionally, the final housings for the motors were designed today. They incorporate arches which are connected to blocks on either side. It's a tight fit, and the force exerted by the arch on the motor, along with the limited space for movement, is generally sufficient to prevent them from being moved around while running.

The motor housings

No comments:

Post a Comment