{"id":359,"date":"2016-09-02T23:03:43","date_gmt":"2016-09-02T23:03:43","guid":{"rendered":"http:\/\/blogs.ischool.berkeley.edu\/i262\/?p=359"},"modified":"2016-09-02T23:03:43","modified_gmt":"2016-09-02T23:03:43","slug":"lab-01-molly","status":"publish","type":"post","link":"https:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/02\/lab-01-molly\/","title":{"rendered":"Lab 01 &#8211; Molly"},"content":{"rendered":"<p><strong>Description:<\/strong><br \/>\n<br \/>\nFor this lab, I began with the simple on\/off LED example to get used to the Arduino board. After that, I wanted to try putting multiple LEDs into the circuit. I found some examples online that showed me how to initialize the other LEDs into different ports in my Arduino, and how to create loops to run those. I ended up using all three LEDs, and lighting them in order sequentially.<br \/>\n(I had looked to find information on running multiple LEDs at different rates at the same time, but wasn&#8217;t able to find anything simple to implement. It seemed like the <code>delay()<\/code> function allowed other loops to start running? I&#8217;d like to explore this more but haven&#8217;t yet.)<br \/>\n<br \/>\n<strong>Components:<\/strong><\/p>\n<ul>\n<li>1 Arduino Uno<\/li>\n<li>1 breadboard<\/li>\n<li>3 LEDs<\/li>\n<li>3 220\u03a9 resistors<\/li>\n<li>jumper wires<\/li>\n<li>USB cable<\/li>\n<li>computer<\/li>\n<\/ul>\n<p>\n<strong>Code:<\/strong><br \/>\n<code>int led1 = 13;<br \/>\nint led2 = 10;<br \/>\nint led3 = 6;<\/p>\n<p>void setup() {<br \/>\n  \/\/ put your setup code here, to run once:<br \/>\n  pinMode(led1, OUTPUT);<br \/>\n  pinMode(led2, OUTPUT);<br \/>\n  pinMode(led3, OUTPUT);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\n  \/\/ put your main code here, to run repeatedly:<br \/>\n  digitalWrite(led1, HIGH);<br \/>\n  delay(1000);<br \/>\n  digitalWrite(led1, LOW);<br \/>\n  delay(100);<br \/>\n  digitalWrite(led2, HIGH);<br \/>\n  delay(1000);<br \/>\n  digitalWrite(led2, LOW);<br \/>\n  delay(100);<br \/>\n  digitalWrite(led3, HIGH);<br \/>\n  delay(1000);<br \/>\n  digitalWrite(led3, LOW);<br \/>\n  delay(100);<br \/>\n}<\/code><\/p>\n<p><strong>Photos:<\/strong><br \/>\n<br \/>\nsingle LED<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1169-300x225.jpg\" alt=\"IMG_1169\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-361\" srcset=\"https:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1169-300x225.jpg 300w, https:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1169-768x576.jpg 768w, https:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1169-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n<br \/>\nthree LEDs<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1172-300x225.jpg\" alt=\"IMG_1172\" width=\"300\" height=\"225\" class=\"alignnone size-medium wp-image-362\" srcset=\"https:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1172-300x225.jpg 300w, https:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1172-768x576.jpg 768w, https:\/\/blogs.ischool.berkeley.edu\/i262\/files\/2016\/09\/IMG_1172-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: For this lab, I began with the simple on\/off LED example to get used to the Arduino board. After that, I wanted to try putting multiple LEDs into the circuit. I found some examples online that showed me how &hellip; <a href=\"https:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/02\/lab-01-molly\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3023,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60082],"tags":[66671],"class_list":["post-359","post","type-post","status-publish","format-standard","hentry","category-lab1","tag-molly"],"_links":{"self":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts\/359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/users\/3023"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/comments?post=359"}],"version-history":[{"count":0,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts\/359\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/media?parent=359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/categories?post=359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/tags?post=359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}