{"id":45,"date":"2006-09-12T08:56:27","date_gmt":"2006-09-12T13:56:27","guid":{"rendered":"http:\/\/www.tigoe.com\/pcomp\/code2\/category\/arduinowiring\/45"},"modified":"2008-01-21T21:32:54","modified_gmt":"2008-01-22T02:32:54","slug":"lantronix-test-program","status":"publish","type":"post","link":"https:\/\/www.tigoe.com\/pcomp\/code\/arduinowiring\/45\/","title":{"rendered":"Lantronix Test Program"},"content":{"rendered":"<p>This is a very simple program to test the serial-to-ethernet connections of a Lantronix device connected to an Arduino or Wiring board.<\/p>\n<p><!-- technorati tags start --><\/p>\n<p style=\"text-align:right;font-size:10px;\">Technorati Tags: <a href=\"http:\/\/www.technorati.com\/tag\/networked objects\" rel=\"tag\">networked objects<\/a>, <a href=\"http:\/\/www.technorati.com\/tag\/networks\" rel=\"tag\">networks<\/a><\/p>\n<p><!-- technorati tags end --><br \/>\n<!--more--><\/p>\n<pre>\/*\n  Lantronix Test Sketch\n  \n  This sketch is written for an Arduino connected to a Lantronix device.\n  It simply says \"hello\" to any byte received in the serial port.\n  To test, telnet into your Lantronix device and type any key. \n  You should get a \"hello\" for every byte sent.\n  \n  Note that there is a 2-second reset at the beginning of the program.\n  \n  Connections:\n  Lantronix TX --&gt; Arduino RX\n  Lantronix RX --&gt; Arduino TX\n  Lantronix Reset --&gt; Arduino pin 3\n  \n  By Tom Igoe\n  Created 11 Sept. 2006\n  \n*\/\n\n#define deviceResetPin 3\n\n void setup() {\n   Serial.begin(9600);\n   pinMode(deviceResetPin, OUTPUT);\n   resetDevice();\n }\n \n void loop() {\n    \/\/ until you get a C, keep trying to connect:\n    \/\/ read the serial port:\n    if (Serial.available()) {\n     char inByte = Serial.read();\n     Serial.println(\"hello\");\n    }\n }\n \n\/*\n  Take the Lantronix device's reset pin low to reset it\n *\/\nvoid resetDevice() {\n  digitalWrite(deviceResetPin, LOW);\n  delay(50);\n  digitalWrite(deviceResetPin, HIGH);\n\n  \/\/ pause to let Lantronix device boot up:\n  delay(2000);\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a very simple program to test the serial-to-ethernet connections of a Lantronix device connected to an Arduino or Wiring board.\/* Lantronix Test Sketch This sketch is written for an Arduino connected to a Lantronix device.  It simply says &#8220;hello&#8221; to any byte received in the serial port.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,13],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-arduinowiring","category-Lantronix"],"_links":{"self":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":0,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tigoe.com\/pcomp\/code\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}