{"id":371,"date":"2016-09-03T03:05:00","date_gmt":"2016-09-03T03:05:00","guid":{"rendered":"http:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/03\/lab-01-sandeep\/"},"modified":"2016-09-03T03:07:29","modified_gmt":"2016-09-03T03:07:29","slug":"lab-01-sandeep","status":"publish","type":"post","link":"https:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/03\/lab-01-sandeep\/","title":{"rendered":"Lab 01 &#8211; Sandeep"},"content":{"rendered":"<p>Description<\/p>\n<p>The lab was about the basic task of blinking an LED.\u00a0I connected the output pin 13 and the ground pin to the breadboard. Next I placed a resistor (220 ohms) on the breadboard and connected it to the jumper cable connecting output pin 13. The long leg of the LED was connected to the resistor and the shorter was connected to the jumper cable connecting to the ground pin. I wrote a code to vary the duration of LED blinking using a for loop. This reminded me of the lights we have up at diwali\u00a0(festival of lights) where a similar random repeating set of LEDs are lit.<\/p>\n<p>Components<\/p>\n<ul>\n<li>1 Arduino Uno R3<\/li>\n<li>1 Breadboard<\/li>\n<li>1 LED<\/li>\n<li>5 jumper cables<\/li>\n<li>1 USB power cable<\/li>\n<\/ul>\n<p>Code<br \/>\n<code><br \/>\n\/*<br \/>\n * Lab 01: LED Blink<br \/>\n * Sandeep Pal<br \/>\n * Prof : Kimiko Ryokai<br \/>\n * TA : Noura Howell<br \/>\n *<br \/>\n * Description:<br \/>\n *<br \/>\n * The following code is a modification of the basic example of LED blinking using and Arduino<br \/>\n * I have made the LEDs blink at a varying rate over time by using a for loop<br \/>\n *<br \/>\n * Materials:<br \/>\n *<br \/>\n * 1 Arduino Uno R3<br \/>\n * 1 Breadboard<br \/>\n * 1 LED<br \/>\n * 5 jumper cables<br \/>\n * 1 USB power cable<br \/>\n *<br \/>\n *<br \/>\n *\/<\/p>\n<p> \/*<br \/>\n  * Defining output pin<br \/>\n  *\/<br \/>\nint ledPin = 13;<\/p>\n<p>\/*<br \/>\n * Writing the setup function to initialize the output pin to 13<br \/>\n *\/<br \/>\nvoid setup() {<br \/>\n  pinMode( ledPin, OUTPUT);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\n  \/\/ writing a for loop to vary the duration for which the LED should blink<br \/>\n  for(int j =0; j<5;j++){\n    int jVal = j*200;\n    \/\/writing high voltage to the digital output : 13\n    digitalWrite(ledPin, HIGH);\n    \/\/modifying the delay based on the loop variable\n    delay(1000-jVal);\n    \/\/writing low voltage to the digital output : 13\n    digitalWrite(ledPin, LOW);\n    delay(jVal);\n  }\n}\n<\/code><br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description The lab was about the basic task of blinking an LED.\u00a0I connected the output pin 13 and the ground pin to the breadboard. Next I placed a resistor (220 ohms) on the breadboard and connected it to the jumper &hellip; <a href=\"https:\/\/blogs.ischool.berkeley.edu\/i262\/2016\/09\/03\/lab-01-sandeep\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3256,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60082],"tags":[105,66679,66680],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-lab1","tag-arduino","tag-blink","tag-led"],"_links":{"self":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts\/371","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\/3256"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":0,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ischool.berkeley.edu\/i262\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}