Test Coding - Weeks 7, 8 & 9
After a busy few weeks of not being able to work on the project, I sat down and did some research on Arduino coding and the Tri-axial accelerometer. I found a lot of Arduino help but sorting through the stuff that was of no use to me and finding the few pieces of code I needed was the hard part.
In our project we will be using the accelerometer as a sensor to detect deceleration in order for the Arduino to determine when to flash the brake lights. Therefore, the code I needed was to let the Arduino know what the signals being fed to it meant and to tell it to send power to a digital output when the signal is below a certain value. Below is what I came up with.
This sketch was purely to test the code and get a better understanding for it. The next step is to do some testing on the values given from the accelerometer chip and set up the full circuit with the transistor, relay, and the 4 LED's.