Friday, November 29, 2013

Friday, November 29
Tuesday, we wrote the code for our car that integrates an IR remote, two motors, and the RGB led light. The code will allow a user to drive the car using the IR remote, and with each different direction that the car goes, a different color light is lit. A copy of the code is given below.
The motors that we are using are gear motors with two wires that can connect directly into digital PWM pins of the arduino board.  One of the wires allows the motor to spin clockwise, and the other wire allows for counter clockwise rotation.  Because of this, coding our car was alot easier to do than we originally thought.  An H-bridge was also not necessary because of the simplicity of the motor pins.  We used the IR library that Prof. Sullivan posted to the Design Lab blog, which made setting up and using the IR remote very easy.  The RGB led was integrated into the code to help tell what is going on when a button is pressed. With the way the code is written now, the led glows green when going forward, red when going backward, blue when it turns left, purple when it turns right, and white when it is not moving.
A video of the code uploaded to the arduino board with the motors and led attached is below.



This final code might be slightly altered if we decide to change how the car is going to turn. The way it is now, to turn either left or right, the corresponding wheel will spin while the other is stopped. We also are thinking of ways to integrate the "A", "B", and "C" buttons into the car.  Right now we are thinking of doing pre-set paths that the car will follow.

We also sent in our parts for 3D printing and laser cutting.  We needed to print 4 parts, two of our L-brackets and two of the motor brackets.  Images of these two final models submitted are below.



The code took about an hour to write and add comments. We should have our new motors and our printed and laser cut parts altogether by early next week so that we can begin building the working model.

No comments:

Post a Comment