Arduino Laser Cannon
Arduino Command Interpreter
- Name: Arduino Command Interpreter
- Status: in mid development, but is working.
- Technology: Arduino
- Author: russ_hensel ( where you can find an email address to reach me )
- Summary: This is set up to become a library that provides a command interface into the Arduino.
A project using this library is: Arduino Laser Cannon
Unlike Firmata [1] this is meant to be used with a human issuing the commands.
Archive for the project will be posted. See download section below.
Interface
The basic idea is that commands to the Arduino consist of a single letter followed by a carriage return line feed ( a pretty basic line ending used by many terminal program ) Using letters often makes it easy to remember what the command stands for l for load, s for save, ? for help, etc. (of course what letter stands for what is up to you and your program. ) Often this is not quite enough, you would like to use a number as well so you get commands like f22 meaning something like go forward 22 units. ( numbers are currently all decimal ). Finally for convientience you may want to make the commands case insensitive so “f” an “F” both have the same meaning. Finally the backspace character is implemented to back up the cursor within the string ( usefull for terminal programs that send characters as soon as you type them.
Program Design
In general I tried to avoid the use of Arduino libraries which I was afraid would bulk up the code too much. I did incorporate “Serial” as it is a fairly lean library and I might not due even as well. The code is meant to poll ( not interrupt driven ) the serial port and accumulate characters until a full string is read ( as determined by the ending character – normally a cr ). If you are a bit late in reading the Serial library and the hardware do some buffering. In pratice I do not see input buffer overrun, although by typing fast or other techniques you could probably produce it. Most non printing characters are just thrown away. You cannot write beyound the code max string length (), characters are just thrown away. The code is pretty well commented you should be able to fingue out most details by reading it. Aditionally the library is used with a couple of my other programs, the setup and main loop of these programs shows how to use the library in your code.
Download
Use the download at Arduino Laser Cannon the command interface is part of this project.
Links
- More information on serial communications with microcontrollers: Microcontroller Serial Communications Articles
- Arduino Laser Cannon
- Firmata Reference
- [[]]
- [[]]