{"id":1820,"date":"2013-08-31T14:58:25","date_gmt":"2013-08-31T12:58:25","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=1820"},"modified":"2021-11-22T17:16:05","modified_gmt":"2021-11-22T16:16:05","slug":"wie-kann-eine-kommando-shell-fuer-arduino-verwendet-werden","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=1820","title":{"rendered":"Wie kann eine Kommando Shell (bitlash) f\u00fcr Arduino verwendet werden?"},"content":{"rendered":"<p>Es gibt f\u00fcr Arduino eine Kommando Shell mit Namen <a href=\"https:\/\/github.com\/billroy\/bitlash\" title=\"Bitlash\" target=\"_blank\" rel=\"noopener\">Bitlash<\/a>. Auch eine <a href=\"https:\/\/github.com\/billroy\/bitlash\/wiki\/install\" title=\"Anleitung zu Bitlash\" target=\"_blank\" rel=\"noopener\">Anleitung<\/a> ist auf Hompage des Entwicklers zu finden.<\/p>\n<p>Hier die n\u00f6tigen Schritte, um ein Arduino (Nano) damit zu best\u00fccken.<\/p>\n<p>Zuerst einmal die neueste Version (2.0) von bitlash installieren, dazu in das Libraries Verzeichnis von Arduino wechseln und per git die Neueste Version holen:<br \/>\n<code><br \/>\ncd ~\/Documents\/Arduino\/Libraries<br \/>\ngit clone https:\/\/github.com\/billroy\/bitlash.git<br \/>\n<\/code><br \/>\noder auch als <a href=\"https:\/\/github.com\/billroy\/bitlash\/wiki\/download\" title=\"Zip bitlash\" target=\"_blank\" rel=\"noopener\">ZIP<\/a> und dann auspacken.<\/p>\n<p>Dann die Arduino IDE (1.5.2) starten und \u00fcber das Men\u00fc: <code>Datei-Beispiele-bitlash-Bitlashdemo<\/code> das Beispiel Sketch laden, compilieren und auf den Arduino hochladen.<\/p>\n<p>Wenn dann der Serielle-Monitor aufgemacht wird, ist es bei mir mit dem Nano abgest\u00fcrzt.<br \/>\nDeshalb habe ich die Geschwindigkeit auf 9600 ge\u00e4ndert. Hier das angepasste Beispiel Sketch:<br \/>\n<code><br \/>\n<span style=\"color: #7E7E7E;\">\/**<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\ttwbitlash.pde&nbsp;Thomas&nbsp;Wenzlaff&nbsp;http:\/\/www.wenzlaff.de&nbsp;Version&nbsp;1.0&nbsp;vom&nbsp;31.08.2013<\/span><\/p>\n<p><span style=\"color: #7E7E7E;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Beispiel&nbsp;einen&nbsp;einfachen&nbsp;Kommandointerpreter&nbsp;f&#252;r&nbsp;den&nbsp;Arduino&nbsp;Nano.<\/span><br \/>\n<span style=\"color: #7E7E7E;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><br \/>\n<span style=\"color: #7E7E7E;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Basis&nbsp;Beispielprogramm&nbsp;von:<\/span><\/p>\n<p><span style=\"color: #7E7E7E;\">\tBitlash&nbsp;is&nbsp;a&nbsp;tiny&nbsp;language&nbsp;interpreter&nbsp;that&nbsp;provides&nbsp;a&nbsp;serial&nbsp;port&nbsp;shell&nbsp;environment<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tfor&nbsp;bit&nbsp;banging&nbsp;and&nbsp;hardware&nbsp;hacking.<\/span><\/p>\n<p><span style=\"color: #7E7E7E;\">\tThis&nbsp;is&nbsp;an&nbsp;example&nbsp;demonstrating&nbsp;how&nbsp;to&nbsp;use&nbsp;the&nbsp;Bitlash2&nbsp;library&nbsp;for&nbsp;Arduino&nbsp;0015.<\/span><\/p>\n<p><span style=\"color: #7E7E7E;\">\tBitlash&nbsp;lives&nbsp;at:&nbsp;http:\/\/bitlash.net<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tThe&nbsp;author&nbsp;can&nbsp;be&nbsp;reached&nbsp;at:&nbsp;bill@bitlash.net<\/span><\/p>\n<p><span style=\"color: #7E7E7E;\">\tCopyright&nbsp;(C)&nbsp;2008-2012&nbsp;Bill&nbsp;Roy<\/span><\/p>\n<p><span style=\"color: #7E7E7E;\">\tPermission&nbsp;is&nbsp;hereby&nbsp;granted,&nbsp;free&nbsp;of&nbsp;charge,&nbsp;to&nbsp;any&nbsp;person<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tobtaining&nbsp;a&nbsp;copy&nbsp;of&nbsp;this&nbsp;software&nbsp;and&nbsp;associated&nbsp;documentation<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tfiles&nbsp;(the&nbsp;\"Software\"),&nbsp;to&nbsp;deal&nbsp;in&nbsp;the&nbsp;Software&nbsp;without<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\trestriction,&nbsp;including&nbsp;without&nbsp;limitation&nbsp;the&nbsp;rights&nbsp;to&nbsp;use,<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tcopy,&nbsp;modify,&nbsp;merge,&nbsp;publish,&nbsp;distribute,&nbsp;sublicense,&nbsp;and\/or&nbsp;sell<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tcopies&nbsp;of&nbsp;the&nbsp;Software,&nbsp;and&nbsp;to&nbsp;permit&nbsp;persons&nbsp;to&nbsp;whom&nbsp;the<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tSoftware&nbsp;is&nbsp;furnished&nbsp;to&nbsp;do&nbsp;so,&nbsp;subject&nbsp;to&nbsp;the&nbsp;following<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tconditions:<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\t<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tThe&nbsp;above&nbsp;copyright&nbsp;notice&nbsp;and&nbsp;this&nbsp;permission&nbsp;notice&nbsp;shall&nbsp;be<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tincluded&nbsp;in&nbsp;all&nbsp;copies&nbsp;or&nbsp;substantial&nbsp;portions&nbsp;of&nbsp;the&nbsp;Software.<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\t<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tTHE&nbsp;SOFTWARE&nbsp;IS&nbsp;PROVIDED&nbsp;\"AS&nbsp;IS\",&nbsp;WITHOUT&nbsp;WARRANTY&nbsp;OF&nbsp;ANY&nbsp;KIND,<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tEXPRESS&nbsp;OR&nbsp;IMPLIED,&nbsp;INCLUDING&nbsp;BUT&nbsp;NOT&nbsp;LIMITED&nbsp;TO&nbsp;THE&nbsp;WARRANTIES<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tOF&nbsp;MERCHANTABILITY,&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE&nbsp;AND<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tNONINFRINGEMENT.&nbsp;IN&nbsp;NO&nbsp;EVENT&nbsp;SHALL&nbsp;THE&nbsp;AUTHORS&nbsp;OR&nbsp;COPYRIGHT<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tHOLDERS&nbsp;BE&nbsp;LIABLE&nbsp;FOR&nbsp;ANY&nbsp;CLAIM,&nbsp;DAMAGES&nbsp;OR&nbsp;OTHER&nbsp;LIABILITY,<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tWHETHER&nbsp;IN&nbsp;AN&nbsp;ACTION&nbsp;OF&nbsp;CONTRACT,&nbsp;TORT&nbsp;OR&nbsp;OTHERWISE,&nbsp;ARISING<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tFROM,&nbsp;OUT&nbsp;OF&nbsp;OR&nbsp;IN&nbsp;CONNECTION&nbsp;WITH&nbsp;THE&nbsp;SOFTWARE&nbsp;OR&nbsp;THE&nbsp;USE&nbsp;OR<\/span><br \/>\n<span style=\"color: #7E7E7E;\">\tOTHER&nbsp;DEALINGS&nbsp;IN&nbsp;THE&nbsp;SOFTWARE.<\/span><br \/>\n<span style=\"color: #7E7E7E;\">**\/<\/span><\/p>\n<p>#include&nbsp;<span style=\"color: #006699;\">\"bitlash.h\"<\/span><\/p>\n<p><span style=\"color: #CC6600;\">void<\/span> <span style=\"color: #CC6600;\"><b>setup<\/b><\/span>(<span style=\"color: #CC6600;\">void<\/span>) {<\/p>\n<p>\t<span style=\"color: #7E7E7E;\">\/\/ Initialisierung und setzen der Baud Rate 57000 bricht beim Nano ab<\/span><br \/>\n\t<span style=\"color: #7E7E7E;\">\/\/ Startet den Kommandozeileninterpreter und f&#252;hrt den startup Makro aus<\/span><br \/>\n\tinitBitlash(9600);<br \/>\n}<\/p>\n<p><span style=\"color: #CC6600;\">void<\/span> <span style=\"color: #CC6600;\"><b>loop<\/b><\/span>(<span style=\"color: #CC6600;\">void<\/span>) {<br \/>\n\trunBitlash();<br \/>\n}<br \/>\n<\/code><br \/>\nund dann l\u00e4uft dieses Beispiel.<\/p>\n<p>Nach \u00f6ffnen des Seriellen Monitors in der IDE (1.5.2) erscheint:<br \/>\n<figure id=\"attachment_1823\" aria-describedby=\"caption-attachment-1823\" style=\"width: 659px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.40.30.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.40.30.png\" alt=\"Bitlash Startbildschirm\" width=\"659\" height=\"363\" class=\"size-full wp-image-1823\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.40.30.png 659w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.40.30-300x165.png 300w\" sizes=\"auto, (max-width: 659px) 100vw, 659px\" \/><\/a><figcaption id=\"caption-attachment-1823\" class=\"wp-caption-text\">Bitlash Startbildschirm<\/figcaption><\/figure><br \/>\nAlle Kommandos lassen sich mit <code>help<\/code> anzeigen:<br \/>\n<figure id=\"attachment_1822\" aria-describedby=\"caption-attachment-1822\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.43.14.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.43.14-1024x215.png\" alt=\"Bitlash 2.0 Online Hilfe\" width=\"640\" height=\"134\" class=\"size-large wp-image-1822\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.43.14-1024x215.png 1024w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.43.14-300x63.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.43.14-940x198.png 940w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.43.14.png 1419w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-1822\" class=\"wp-caption-text\">Bitlash 2.0 Online Hilfe<\/figcaption><\/figure><br \/>\nWie dann die erste Funktion erstellt wird, steht <a href=\"https:\/\/github.com\/billroy\/bitlash\/wiki\/install\" title=\"bitlash beispiel\" target=\"_blank\" rel=\"noopener\">hier<\/a>.<br \/>\nKurz, um die LED 13 blinken zu lassen folgende Befehle eingeben:<br \/>\n<code><br \/>\nfunction toggle13 {d13 = !d13;}<br \/>\nfunction startup {pinmode(13,1); run toggle13,1000;}<br \/>\nstartup<br \/>\nboot<br \/>\n<\/code><br \/>\nFunktionen lassen sich mit <code>ls<\/code> anzeigen:<br \/>\n<figure id=\"attachment_1824\" aria-describedby=\"caption-attachment-1824\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.51.59.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.51.59-1024x278.png\" alt=\"Erstes Beispiel\" width=\"640\" height=\"173\" class=\"size-large wp-image-1824\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.51.59-1024x278.png 1024w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.51.59-300x81.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2013\/08\/Bildschirmfoto-2013-08-31-um-14.51.59.png 1312w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-1824\" class=\"wp-caption-text\">Erstes Beispiel<\/figcaption><\/figure><\/p>\n<p>Weitere Doku <a href=\"https:\/\/github.com\/billroy\/bitlash\/wiki\/docindex\" title=\"https:\/\/github.com\/billroy\/bitlash\/wiki\/docindex\">hier<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Es gibt f\u00fcr Arduino eine Kommando Shell mit Namen Bitlash. Auch eine Anleitung ist auf Hompage des Entwicklers zu finden. Hier die n\u00f6tigen Schritte, um ein Arduino (Nano) damit zu best\u00fccken. Zuerst einmal die neueste Version (2.0) von bitlash installieren, dazu in das Libraries Verzeichnis von Arduino wechseln und per git die Neueste Version holen: &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=1820\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eWie kann eine Kommando Shell (bitlash) f\u00fcr Arduino verwendet werden?\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[562,79],"tags":[2188,860,861,823,862],"class_list":["post-1820","post","type-post","status-publish","format-standard","hentry","category-arduino","category-programmierung","tag-arduino","tag-bitlash","tag-bitlash-2-0","tag-kommandozeile","tag-shell"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/1820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1820"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/1820\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1820"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}