<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>LDR Camera #2 : Adding an 8x8 Dot Matrix LED Display</title><link>/challenges-projects/project14/visionthing/b/blog/posts/ldr-camera-2-adding-an-8x8-dot-matrix-led-display</link><description>Vision Thing Enter Your Project for a chance to win an Oscilloscope Grand Prize Package for the Most Creative Vision Thing Project! Back to The Project14 homepage Project14 Home Monthly Themes Monthly Theme Poll While I was waiting for the analogue .</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: LDR Camera #2 : Adding an 8x8 Dot Matrix LED Display</title><link>https://community.element14.com/challenges-projects/project14/visionthing/b/blog/posts/ldr-camera-2-adding-an-8x8-dot-matrix-led-display</link><pubDate>Sat, 28 Sep 2019 02:36:47 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:04ccc59a-3f1a-4b72-a881-4d1153b9e6cf</guid><dc:creator>clem57</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Great job &lt;span&gt;[mention:d25512d61e65470296ce2f82f47741ab:e9ed411860ed4f2ba0265705b8793d05]&lt;/span&gt;. If you would like a bit of grey scale, you could turn on 0-8 depending on the level of grey and this would look like a graph of darkness or lightness. I will show using just the 3 LDR. The others are the same method.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Gval = value from ldr #3 / 32; The result should be from 0 through 7... So 0-31 is 0, 32-63 is 1, etc. up to 255.&lt;/p&gt;&lt;p&gt;&lt;span&gt; if (LDRvalue &amp;gt; threshold)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; matrix.drawPixel(Gval, 3, 1);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; matrix.drawPixel(Gval, 3, 0);&amp;nbsp; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Clem&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7853&amp;AppID=240&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: LDR Camera #2 : Adding an 8x8 Dot Matrix LED Display</title><link>https://community.element14.com/challenges-projects/project14/visionthing/b/blog/posts/ldr-camera-2-adding-an-8x8-dot-matrix-led-display</link><pubDate>Fri, 27 Sep 2019 20:57:47 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:04ccc59a-3f1a-4b72-a881-4d1153b9e6cf</guid><dc:creator>shabaz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Dubbie,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Glad the display is coming in handy : )&lt;/p&gt;&lt;p&gt;Adafruit had some code, but it was slightly bloated, so I too wrote my own code. There is some slightly weird mapping, as no doubt you spotted! : )&lt;/p&gt;&lt;p&gt;Anyway, it sounds all sorted, otherwise &lt;a class="jive-link-external-small" href="https://github.com/shabaz123/pocket-nim/blob/master/pocket-nim/main.c" rel="nofollow ugc noopener" target="_blank"&gt;see the Pocket Nim code&lt;/a&gt; from line 828 onward (not tested on Arduino, but the I2C specific stuff is isolated to the first two functions from that line onward, so those could be replaced).&lt;/p&gt;&lt;p&gt;For the code above, something like this might work (this could be improved too, it&amp;#39;s just to reduce the code a bit).&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=c_cpp&amp;amp;text=%23define+LED_ON+1%0A%23define+LED_OFF+0%0A%0A%0Avoid+loop%28%29+%7B%0A%0A%0A++int+i%2C+a%3B%0A++int+ldr_pin%5B%5D%3D%7BA0%2C+A1%2C+A2%2C+A3%2C+A4%2C+A5%2C+A6%2C+A7%7D%3B%0A++while%281%29%0A++%7B%0A++++matrix.clear%28%29%3B%0A++++for+%28i%3D0%3B+i%3C8%3B+i%2B%2B%29%0A++++%7B%0A++++++a%3DanalogRead%28ldr_pin%5Bi%5D%29%3B%0A++++++Serial.print%28a%29%3B%0A++++++Serial.print%28%22+%22%29%3B%0A++++++%0A++++++if+%28a%3Ethreshold%29%0A++++++%7B%0A++++++++matrix.drawPixel%280%2C+i%2C+LED_ON%29%3B%0A++++++%7D%0A++++++else%0A++++++%7B%0A++++++++matrix.drawPixel%280%2C+i%2C+LED_OFF%29%3B%0A++++++%7D%0A++++%7D%0A++++matrix.writeDisplay%28%29%3B%0A++++delay%28500%29%3B%0A++%7D+%2F%2F+end+while%281%29%0A++%0A%7D]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=7853&amp;AppID=240&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>