Let’s Get Started..
Blinky is the “Hello World” of Physical Computing
How do we implement this?
Digital Output
Three functions to know…
pinMode(pin, INPUT/OUTPUT); ex: pinMode(13, OUTPUT); digitalWrite(pin, HIGH/LOW); ex: digitalWrite(13, HIGH); delay(time_ms); ex: delay(2500); // delay of 2.5 sec. // NOTE: -> functions are CASE-sensitive]] ></ac:plain-text-body></ac:structured-macro><p><span style="color: rgb(0,0,0);"><a href="https://www.arduino.cc/en/Reference">https://www.arduino.cc/en/Reference</a></span></p><h3><span style="color: rgb(0,0,0);"><strong>Blink</strong></span></h3><table><colgroup><col /><col /></colgroup><tbody><tr><td><div class="content-wrapper"><p><ac:image><ri:attachment ri:filename="image2019-7-31_17-0-47.png" /></ac:image></p></div></td><td><div class="content-wrapper"><p><ac:image ac:height="400"><ri:attachment ri:filename="image2020-1-19_22-52-35.png" /></ac:image></p><p>Arduino UNO has a built-in LED connected to digital pin 13.</p></div></td></tr></tbody></table><p><br /></p><p>Type (instead of copy-pasting, if you are new to C/C++) this code, click “Upload” and observe the built-in LED. You have just completed your first Arduino program!</p><table class="wrapped"><colgroup><col /><col /></colgroup><tbody><tr><th>C++</th><th>Blocks</th></tr><tr><td><div class="content-wrapper"><ac:structured-macro ac:name="code" ac:schema-version="1" ac:macro-id="3372295e-a506-4416-9aab-768f3aee4987"><ac:parameter ac:name="language">cpp</ac:parameter><ac:parameter ac:name="theme">Confluence</ac:parameter><ac:plain-text-body><![CDATA[// the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }]] ></ac:plain-text-body></ac:structured-macro></div></td><td><div class="content-wrapper"><p><ac:image ac:thumbnail="true" ac:width="240"><ri:attachment ri:filename="image2020-1-19_22-34-39.png" /></ac:image></p><p><br /></p></div><p>Instead of using<ac:image ac:thumbnail="true" ac:width="150"><ri:attachment ri:filename="image2020-1-19_22-36-18.png" /></ac:image>,</p><p>it is fine to use<ac:image ac:thumbnail="true" ac:width="150"><ri:attachment ri:filename="image2020-1-19_22-33-59.png" /></ac:image> for pin 13.</p></td></tr></tbody></table><h3>Screencast</h3><p><ac:structured-macro ac:name="widget" ac:schema-version="1" ac:macro-id="2443c125-078f-44f1-945d-470c8662ceb0"><ac:parameter ac:name="url"><ri:url ri:value="http://youtube.com/watch?v=WAx6cmu3034" /></ac:parameter></ac:structured-macro></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p><p><br /></p>