Open a box with the flick of a switch!

 by mymixed

Step 3: Program It!

I like to test the code first, before putting it in the case (the box). This way, you can perfect the code and get it right, and not destroy things later. To program it, It's like any other arduino code. Just open up the arduino project, connect your arduino, and press upload! Once you do that, your continuous rotation servo should start to spin. It will spin until it finds a button to press and then stop. When you flip the power switch to the next state, it will spin in the other direction until it finds another button to press. Believe it or not this was actually pretty hard code to write. If your just starting with arduino, you might be able to learn something from it!
 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!