Step 11Program with arduino IDE
The code can be found here: BEBL2.pde. Copy and paste into a new project on Arduino. If you take a look at the code, you will find that it is more complex than you might expect due to the digital filtering, without which the brake light would be going on and off constantly. You will also see some calibration routines I used to figure out the accelerometer readings. One funny thing about the breakout board, is that a different analog RC filter is on each axis. So each axis behaves a little differently. I put default values in the the code that work well with all three of the accelerometers I've gotten from pololu, but you can overwrite them using your own values or by the calibration routines.
Program the chip using a standard Diecmila or your favorite board with removable MEGA IC.
Remove the MEGA from the programming board and insert into the 28-pin socket with pin1 toward the bar end plug.
Insert battery.
Cross fingers.
Flip switch.
Congratulations if you should see a blinking light!
If not try flipping the battery over. Still not? Flip switch the other way.
If it still does not work go on to the next step: Debugging.
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|


















































