Thursday, December 12, 2013

Thursday, December 12, 2013

Today we finished our car! We made some pretty cool additions to the car, one of which is the piezzo buzzer, seen below.

The buzzer is the circular black piece in the upper right corner of the breadboard, and it allowed us to make some horns for our car.  Right now, we programmed the General Lee's car horn from The Dukes of Hazzard to sound when "A" is pressed and The Imperial Death March from Star Wars when "B" is pressed.  Coding these was fairly difficult however.  We used the SIK Guide's Circuit 11 for the piezzo buzzer as a starting point, and then had to look up the notes for these two melodies online.  Once we had the musical notes for the two melodies, we had to guess and check the beats that they were supposed to be played at in order to get them to sound well. Our friend Josh Zubricki helped us alot with this part.  In the end, I think we nailed the two melodies and got them to sound really well.  
Putting these two horns into our original code however was very hard.  We needed to get the help from our computer programming friend, Josh Smolinski, to try to help us.  Apparently, the arduino board has two timers that allow different functions and things happen.  The IRemote library that we downloaded was using the same timer as the piezzo buzzer so the code would not compile.  We had to go into the program files and change the timers that each was using so that they were not running on the same one.  Once we did this, it was fairly easy to integrate the buzzer code into the original one.  A copy of our final code is given below. 


We also fixed our problem with the wheels not spinning at the same speeds.  We took a potentiometer and connected it to the left motor (the one that was spinning faster) so that we could control the amount of voltage going to that motor.  By doing this we were able to slow down that motor to about the same speed as the other motor.
In addition to doing this, we also got some 22 gauge wire and replaced some of the obnoxiously long jumper cables underneath with the H-bridge and a couple on the above breadboard so that it looks nicer and is less messy.

We also wrote our final paper for the project.  Altogether we worked for about 5 hours today which was a lot more than any of us were planning on working on it.

We made decide to set up another melody to play when the "C" button is pressed tomorrow morning before we show off the final car, but other than that we are completely done with the project!

No comments:

Post a Comment