{"categories":["spark core"],"height":"190","blog_url":"https://higepon.hatenablog.com/","provider_url":"https://hatena.blog","image_url":null,"published":"2014-09-10 21:48:20","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhigepon.hatenablog.com%2Fentry%2F20140910%2F1410353300\" title=\" 6. Turn on LED when it&#39;s dark - Spark Core - higepon blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"Now I know how to use the photo resistor. Let\u2019s create useful application, which would turn on LED when it\u2019s dark :) I use exact same bread board setting in 5. Photo Resistor. The point here is we\u2019re using isDark & isOn variables. int voltage = analogRead(A0); bool isDark = voltage <= 50; // Turn on\u2026","type":"rich","blog_title":"higepon blog","url":"https://higepon.hatenablog.com/entry/20140910/1410353300","author_name":"higepon","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/higepon/","version":"1.0","title":" 6. Turn on LED when it's dark - Spark Core"}