3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Bar End Brake Light: BEBL

Step 11Program with arduino IDE

Program with arduino IDE
Finally to the 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 StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
7
Followers
3
Author:WyoJustin(Justin Shaw)