<font face="verdana,sans-serif">Thank you Tom, Jon, and Greg,</font><div><font face="verdana,sans-serif"><br></font></div><div><font face="verdana,sans-serif">I am grateful for all the help while I go through this challenge.</font></div>
<div><font face="verdana,sans-serif"><br></font></div><div><font face="verdana, sans-serif">Tom, I have previously responded to Jon and Greg privately trying to avoid too many emails to the group. </font></div><div><font face="verdana, sans-serif"><br>
</font></div><div><font face="verdana, sans-serif">But yes, your tracking of my progress of the project is right, I basically have proof of concept with hardware, circuits and now it is just the software programming..</font></div>
<div><font face="verdana, sans-serif"><br></font></div><div><font face="verdana, sans-serif">Following the code in the previously mentioned example, I am trying to adapt it to working with the Bar LED..</font></div><div>
<font face="verdana, sans-serif"><br>
</font></div><div><font face="verdana, sans-serif">I have isolated the critical piece of code is </font></div><div><font face="verdana, sans-serif"><br></font></div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">
for x in range(0,8):
a = 1 << x
set_led(a,0)
time.sleep(delay)
set_led(0,0)</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">in code : set_led(x,y) x is the data and y is the bank.</pre>
<pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">so I am confused on x or data piece of the parameter..</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">
in the above code set_led(a,0) </pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><b><font size="4">a= 1 << x what does this statement do?</font></b></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">
<b><font size="4">and I tried just setting a to various numbers 1,2,3,4,5,6,7,8,9 and the led seem to light up in no understandable pattern, sometimes individually and sometimes multiple LEDs go on.. </font></b></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">
<br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">So basically, once I get to know how to control the leds on the bar graph, then I can start deciphering the code for letters and words</pre>
<pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">Thanks to the group</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">
<br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">Ming</pre></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 2:36 PM, Tom Metro <span dir="ltr"><<a href="mailto:tmetro+hhacking@gmail.com" target="_blank">tmetro+hhacking@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Ming kuo wrote:<br>
> Hi Guys, I was recently introduced to this group, so here is my first post.<br>
<br>
</div>Welcome to the group.<br>
<div class="im"><br>
<br>
> I figured out the wiring to get the bar to light up using the same codes<br>
> as above.<br>
<br>
</div>Sounds like you've got the hard part done. If you've gotten that much to<br>
work, then you've proven the hardware works, and the basic software<br>
works. Now you just need to tweak the behavior.<br>
<div class="im"><br>
<br>
> I am stuck...on the python code to control the I2C.<br>
</div><div class="im">> This is my immediate challenge to figure out how to program the<br>
</div>> I2C for the LED bar...<br>
<br>
Can you clarify?<br>
<br>
You said above that you succeeded in getting the bar to light up using<br>
the same setup as the article you referenced. That implies you have a<br>
working I2C driver and some Python code using it.<br>
<br>
<br>
> ...I need to program a python code to POV display the messages which<br>
<div class="im">> i can imaging that it get pretty challenging given how to form a<br>
> character with LED while timing the rotation.<br>
<br>
</div>So POV is persistence of vision? You're looking to build something like:<br>
<a href="http://www.youtube.com/watch?v=fJBYOU-Y-ZU" target="_blank">http://www.youtube.com/watch?v=fJBYOU-Y-ZU</a><br>
<br>
How do you plan to move the display?<br>
<br>
To build on what Jon Evans said in his reply, it sounds like what you<br>
have left to do is less hardware hacking and more basic Python coding.<br>
Looking at the sample code:<br>
<a href="http://www.skpang.co.uk/blog/wp-content/uploads/2012/06/ledchaser.py" target="_blank">http://www.skpang.co.uk/blog/wp-content/uploads/2012/06/ledchaser.py</a><br>
<br>
they provide a set_led() function, so you'll need to remove the two<br>
chunks of code used to strobe the LEDs ("# Move led left " and "# Move<br>
led right") and replace them with your character generating code.<br>
<br>
Not trivial but given that POV displays seem to be popular, likely you<br>
can find some existing code for the character generator. If not, you'll<br>
need to dig up a library or lookup table that maps characters to dot<br>
patterns. Basically a dot matrix font. Then build a function that when<br>
given a character, translates that into the equivalent array of dots.<br>
<br>
I'd be inclined to use an architecture where rows of dots are pushed<br>
onto a stack, and then some background process is responsible for<br>
pulling a row from the stack and lighting up the LEDs on a steady clock<br>
rate. (I'm not sure if that's easy to accomplish in Python.)<br>
<br>
I'm guessing that with most of these POV displays, there isn't any real<br>
synchronization between the display motion and the strobing. The builder<br>
simply tunes the strobe rate until it works most of the time for<br>
whatever RPM their display ends up running at.<br>
<div class="im"><br>
<br>
> So any help through email or in person would be greatly appreciated.<br>
<br>
</div>Post some follow up questions as you get stuck and we'll see what we can do.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Tom<br>
</font></span></blockquote></div><br></div>