{"id":134,"date":"2019-05-22T14:46:39","date_gmt":"2019-05-22T14:46:39","guid":{"rendered":"https:\/\/3dfpo.swarthmore.edu\/?p=134"},"modified":"2020-08-31T14:24:55","modified_gmt":"2020-08-31T14:24:55","slug":"note-on-arduino-use","status":"publish","type":"post","link":"https:\/\/3dfpo.swarthmore.edu\/?p=134","title":{"rendered":"Note on Arduino Use"},"content":{"rendered":"<h1>Before programming<\/h1>\n<p>Use the tool tab on the top to check whether we are using the correct breadboard, processor and port type. Basic program tutorials are written inside Arduino itself, so if we need any reference, we can simply open the examples for help.<\/p>\n<h1>Programming Syntax<\/h1>\n<h2>Initializing the pins<\/h2>\n<ul>\n<li>We first have to decide whether a pin is an input or output by writing pinMode(#num, OUTPUT) or\u00a0pinMode(#num, INPUT).<\/li>\n<li>The syntax for the function is<\/li>\n<\/ul>\n<p>void setup() {<\/p>\n<p>}<\/p>\n<h2>Loop function<\/h2>\n<ul>\n<li>Loop function iterates forever until it stops and its syntax is:<\/li>\n<\/ul>\n<p>void loop() {<\/p>\n<p>}<\/p>\n<h2>Delay function<\/h2>\n<ul>\n<li>delay(time) \u00a0 \u00a0NOTE: time is in milliseconds<\/li>\n<\/ul>\n<h2>Turn on\/off LED<\/h2>\n<ul>\n<li>Turn on the light: digitalWrite(#pinnum, HIGH)<\/li>\n<li>Turn off the light: digitalWrite(#pinnum,LOW)<\/li>\n<\/ul>\n<h1>After programming<\/h1>\n<p>After programming the codes, use the sketch menu on the top bar and click the compile button. After compiling, we click the upload button to transmit \u00a0our program to the breadboard to execute our code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Before programming Use the tool tab on the top to check whether we are using the correct breadboard, processor and port type. Basic program tutorials are written inside Arduino itself, so if we need any reference, we can simply open the examples for help. Programming Syntax Initializing the pins We first have to decide whether &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/3dfpo.swarthmore.edu\/?p=134\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Note on Arduino Use&#8221;<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=\/wp\/v2\/posts\/134"}],"collection":[{"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=134"}],"version-history":[{"count":3,"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":137,"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=\/wp\/v2\/posts\/134\/revisions\/137"}],"wp:attachment":[{"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3dfpo.swarthmore.edu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}