http://www.opencircuits.com/index.php?title=Arduino_Command_Interpreter&feed=atom&action=historyArduino Command Interpreter - Revision history2024-03-28T22:58:26ZRevision history for this page on the wikiMediaWiki 1.34.2http://www.opencircuits.com/index.php?title=Arduino_Command_Interpreter&diff=20062&oldid=prevRuss hensel: /* Program Design */2011-01-02T23:27:29Z<p><span dir="auto"><span class="autocomment">Program Design</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 23:27, 2 January 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l19" >Line 19:</td>
<td colspan="2" class="diff-lineno">Line 19:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Program Design ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Program Design ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>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.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>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 <ins class="diffchange diffchange-inline">the port </ins>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.</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Download ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Download ==</div></td></tr>
</table>Russ henselhttp://www.opencircuits.com/index.php?title=Arduino_Command_Interpreter&diff=20061&oldid=prevRuss hensel: /* Links */2011-01-02T23:26:16Z<p><span dir="auto"><span class="autocomment">Links</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 23:26, 2 January 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l27" >Line 27:</td>
<td colspan="2" class="diff-lineno">Line 27:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Links ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Links ==</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*More information on serial communications with microcontrollers: [[Microcontroller Serial Communications Articles]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*More information on serial communications with microcontrollers: [[Microcontroller Serial Communications Articles]]</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l34" >Line 34:</td>
<td colspan="2" class="diff-lineno">Line 33:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[]]</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>*[[]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[category:Arduino]][[category:Microcontroller]]</ins></div></td></tr>
</table>Russ henselhttp://www.opencircuits.com/index.php?title=Arduino_Command_Interpreter&diff=20008&oldid=prevRuss hensel: /* Interface */2010-12-30T15:46:33Z<p><span dir="auto"><span class="autocomment">Interface</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 15:46, 30 December 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l15" >Line 15:</td>
<td colspan="2" class="diff-lineno">Line 15:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Interface == </div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Interface == </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>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 ). <del class="diffchange diffchange-inline">Finally for </del>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 <del class="diffchange diffchange-inline">within </del>the string ( <del class="diffchange diffchange-inline">usefull </del>for terminal programs that send characters as soon as you type them.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>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 ). <ins class="diffchange diffchange-inline">For </ins>convientience you may want to make the commands case insensitive so “f” an “F” both have the same meaning <ins class="diffchange diffchange-inline">and there is a function that gives you that option</ins>. Finally the backspace character is implemented to back up the cursor <ins class="diffchange diffchange-inline">deleting from the end of </ins>the string ( <ins class="diffchange diffchange-inline">useful </ins>for terminal programs that send characters as soon as you type them <ins class="diffchange diffchange-inline">)</ins>.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Program Design ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Program Design ==</div></td></tr>
</table>Russ henselhttp://www.opencircuits.com/index.php?title=Arduino_Command_Interpreter&diff=20002&oldid=prevRuss hensel: Created page with '= Arduino Command Interpreter = *Name: Arduino Command Interpreter *Status: in mid development, but is working. *Technology: Arduino *Author: russ_hensel ( where you can…'2010-12-30T01:04:24Z<p>Created page with '= Arduino Command Interpreter = *Name: Arduino Command Interpreter *Status: in mid development, but is working. *Technology: Arduino *Author: <a href="/index.php?title=Russ_hensel" title="Russ hensel">russ_hensel</a> ( where you can…'</p>
<p><b>New page</b></p><div>= Arduino Command Interpreter =<br />
<br />
*Name: Arduino Command Interpreter<br />
*Status: in mid development, but is working. <br />
*Technology: Arduino <br />
*Author: [[russ_hensel]] ( where you can find an email address to reach me ) <br />
*Summary: This is set up to become a library that provides a command interface into the Arduino.<br />
<br />
A project using this library is: [[Arduino Laser Cannon]]<br />
<br />
Unlike Firmata [http://www.arduino.cc/en/Reference/Firmata] this is meant to be used with a human issuing the commands. <br />
<br />
Archive for the project will be posted. See download section below. <br />
<br />
== Interface == <br />
<br />
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.<br />
<br />
== Program Design ==<br />
<br />
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.<br />
<br />
<br />
== Download ==<br />
<br />
Use the download at [[Arduino Laser Cannon]] the command interface is part of this project.<br />
<br />
== Links ==<br />
<br />
<br />
*More information on serial communications with microcontrollers: [[Microcontroller Serial Communications Articles]]<br />
*[[Arduino Laser Cannon]]<br />
*[http://www.arduino.cc/en/Reference/Firmata| Firmata Reference]<br />
*[[]]<br />
*[[]]</div>Russ hensel