Saturday, December 12, 2009

Morse Code Arduino Sketch

I've uploaded the Arduino sketch for the Morse code translator here:
http://chaosinacan.x10hosting.com/media/code/morse.zip
It is fully commented, so hopefully it isn't too difficult to figure out.  If it's confusing, just ask me and I'll try to explain it.

Also, if you want to try this project out, this is the circuit diagram for the entire translator.  The potentiometer at the center right was used to control the backlight level, but I replaced it with a setting in the code, so you can ignore that part.  If you're unfamiliar with the symbol, the component on pin 12 is a piezo buzzer.  Everything else should be labeled.



More stuff, like a component list after the break...



Here is a list of the components you will need and links for the more specialized components:

When the translator powers up, it loads settings from its EEPROM.  The first time you start it, nothing meaningful is stored in EEPROM, so it could load gibberish or just 0 into all of its settings.  If this happens, you should be able to get into the menu and do a reset, which will fix this problem forever.  If you can't, comment out the "loadSettings();" on line 60 of morse.pde, run the program, and do a reset.

I should probably explain how the menu works too.  The two pushbutton switches act as Left and Right buttons and the force sensor you tap Morse code into acts as the Enter button.  Press either the Left or Right button to enter the menu.  You can also quickly exit the menu by pressing both Left and Right at the same time.  You navigate through the menu using the Left and Right buttons and make a selection by pressing Enter.  If a number appears, you can edit it by pressing/holding the Left or Right buttons and finish editing by pressing Enter.  If a question appears, like "Reset All?", you choose one of the two answers at the bottom with the Left or Right buttons.

Have fun!

No comments:

Post a Comment