{"id":10777,"date":"2015-11-23T09:12:34","date_gmt":"2015-11-23T07:12:34","guid":{"rendered":"http:\/\/blog.isnochys.de\/?p=10777"},"modified":"2015-11-23T09:12:34","modified_gmt":"2015-11-23T07:12:34","slug":"ambient-light","status":"publish","type":"post","link":"https:\/\/blog.isnochys.de\/?p=10777","title":{"rendered":"Ambient Light"},"content":{"rendered":"<p>So, I just wanted an Ambient Light for my TV.<br \/>\nCould be quite easy.<br \/>\nI got an Arduino and a Cheap RGB LED Strip, here is the working diagram:<\/p>\n<p><a href=\"http:\/\/blog.isnochys.de\/wp-content\/2015\/11\/Ambientlight_Schaltplan.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.isnochys.de\/wp-content\/2015\/11\/Ambientlight_Schaltplan-450x349.jpg\" alt=\"Ambientlight_Schaltplan\" width=\"450\" height=\"349\" class=\"alignnone size-medium wp-image-10778\" srcset=\"https:\/\/blog.isnochys.de\/wp-content\/2015\/11\/Ambientlight_Schaltplan-450x349.jpg 450w, https:\/\/blog.isnochys.de\/wp-content\/2015\/11\/Ambientlight_Schaltplan-1024x795.jpg 1024w, https:\/\/blog.isnochys.de\/wp-content\/2015\/11\/Ambientlight_Schaltplan.jpg 1074w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>Arduino gets Info from USB, and switches the right RGB Vvalues accordingly.<\/p>\n<p>Now my laptop has just to execute this script:<br \/>\n<code><br \/>\nimport java.awt.Robot;<br \/>\nimport java.awt.AWTException;<br \/>\nimport java.awt.event.InputEvent;<br \/>\nimport java.awt.image.BufferedImage;<br \/>\nimport java.awt.Rectangle;<br \/>\nimport java.awt.Dimension;<br \/>\nimport processing.serial.*;<br \/>\nSerial port;<br \/>\nRobot robby;<br \/>\nvoid setup()<br \/>\n{<br \/>\nport = new Serial(this, Serial.list()[0],9600);<br \/>\nsize(100, 100);<br \/>\ntry<br \/>\n{<br \/>\nrobby = new Robot();<br \/>\n}<br \/>\ncatch (AWTException e)<br \/>\n{<br \/>\nprintln(\"Robot class not supported by your system!\");<br \/>\nexit();}}<\/p>\n<p>void draw()<br \/>\n{int pixel;<br \/>\nfloat r=0;<br \/>\nfloat g=0;<br \/>\nfloat b=0;<br \/>\nBufferedImage screenshot = robby.createScreenCapture(new Rectangle(new Dimension(1920,1080)));<br \/>\nint i;<br \/>\nint j;<\/p>\n<p>for(i=0;i&lt;1920; i=i+2){<br \/>\nfor(j=0; j&lt;136;j=j+2){<br \/>\npixel = screenshot.getRGB(i,j);<br \/>\nr = r+(int)(255&(pixel>>16));<br \/>\ng = g+(int)(255&(pixel>>8));<br \/>\nb = b+(int)(255&(pixel)); }}<\/p>\n<p>r=r\/(960*68);<br \/>\ng=g\/(960*68);<br \/>\nb=b\/(960*68);<br \/>\nport.write(0xff);<br \/>\nport.write((byte)(r));<br \/>\nport.write((byte)(g));<br \/>\nport.write((byte)(b));<br \/>\ndelay(10);<br \/>\nbackground(r,g,b);}<br \/>\n<\/code><\/p>\n<p>It works so perfect!<br \/>\nThe light is bright, the colors change nice and fast.<\/p>\n<p>Only problem..my laptop is way to slow!<br \/>\nThis transforms every movie into a dia show..<br \/>\nAnd I even just get the RGB info of the upper 12% of the screen.<\/p>\n<p>Need to<br \/>\n&#8211; find new software<br \/>\n&#8211; get new laptop<br \/>\n&#8211; find new project for my RGB strip;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I just wanted an Ambient Light for my TV. Could be quite easy. I got an Arduino and a Cheap RGB LED Strip, here is the working diagram: Arduino gets Info from USB, and switches the right RGB Vvalues &hellip; <a href=\"https:\/\/blog.isnochys.de\/?p=10777\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-10777","post","type-post","status-publish","format-standard","hentry","category-initializing-devchaos"],"_links":{"self":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts\/10777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10777"}],"version-history":[{"count":1,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts\/10777\/revisions"}],"predecessor-version":[{"id":10779,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=\/wp\/v2\/posts\/10777\/revisions\/10779"}],"wp:attachment":[{"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.isnochys.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}