{"id":77,"date":"2008-09-15T12:21:59","date_gmt":"2008-09-15T16:21:59","guid":{"rendered":"http:\/\/mikelberman.com\/blog\/?p=77"},"modified":"2008-09-15T12:21:59","modified_gmt":"2008-09-15T16:21:59","slug":"potentiameter","status":"publish","type":"post","link":"http:\/\/mikelberman.com\/blog\/?p=77","title":{"rendered":"Potent.i.am.eater"},"content":{"rendered":"<p><em>PComp &#8211; Lab 2<\/em><\/p>\n<p>Since a potentiometer is just a variable resistor, you connect power and ground, and the third pin is the set voltage.\u00a0 I inserted the variable voltage into an analog input on the Arduino, which is read in as a value from 0-1023.\u00a0 I set a series of conditions that would check the voltage, and change brightness of two LEDs.<\/p>\n<p><object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"640\" height=\"510\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,40,0\"><param name=\"src\" value=\"http:\/\/blip.tv\/play\/Ac3Me4+6Eg\" \/><embed type=\"application\/x-shockwave-flash\" width=\"640\" height=\"510\" src=\"http:\/\/blip.tv\/play\/Ac3Me4+6Eg\"><\/embed><\/object><\/p>\n<p>Here are the settings I used:<\/p>\n<p>if (potPos &lt; 300 &amp;&amp; potPos &gt; 100)\u00a0 \/\/potPos is the value of the potentiometer<\/p>\n<p>{<\/p>\n<p>analogWrite(ledYlw, 125); \/\/half brightness<\/p>\n<p>analogWrite(ledRed, 0); \/\/off<\/p>\n<p>}<\/p>\n<p>else if (potPos &gt; 300 &amp;&amp; potPos &lt; 800)<\/p>\n<p>{<\/p>\n<p>analogWrite(ledYlw, 0);<\/p>\n<p>analogWrite(ledRed, 125);<\/p>\n<p>}<\/p>\n<p>else if (potPos &gt; 800)<\/p>\n<p>{<\/p>\n<p>analogWrite(ledYlw, 255);\u00a0 \/\/both full<\/p>\n<p>analogWrite(ledRed, 255);<\/p>\n<p>}<\/p>\n<p>else<\/p>\n<p>{<\/p>\n<p>analogWrite(ledYlw, 0); \/\/both off<\/p>\n<p>analogWrite(ledRed, 0);<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PComp &#8211; Lab 2 Since a potentiometer is just a variable resistor, you connect power and ground, and the third pin is the set voltage.\u00a0 I inserted the variable voltage into an analog input on the Arduino, which is read in as a value from 0-1023.\u00a0 I set a series of conditions that would check [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-physical-computing"],"_links":{"self":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77"}],"version-history":[{"count":6,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions"}],"predecessor-version":[{"id":85,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions\/85"}],"wp:attachment":[{"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mikelberman.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}