web based LCD display hosted by a PINK
I know there has to be a simple way of doing this, taking 123 and separating it out into 1 2 3 each digit held in a separate variable.
Purpose: I want to make a Web LCD Display for my PINK, to display sensor readouts. I've made the LCD digit images 0-9. So if a temp sensor reads 123 deg, the pink would hold 3 values 1, 2, 3, in 3 different variables. and would use those values to display 1.jpg, 2.jpg, 3.jpg. and the images would change as the values change.
is DIG the best command for this. running through a for next loop incrementing the dig value and PINK variable, I kinda want a catch all app where I don't have to worry about number lengths and would like to have the possibility of alpha numeric also. Just want to get some input before I go the long way around the mountain.
I would actually like this to be handled on the PINK in html or Java script so I don't have to use up 2+ variables for every input. but that's beyond my limits.
your input is appreciated. and I'll post my full code and images once it's working... I need to fix some of the images also.
thanks
added:
this is for a BS2SX and eventually I'll want to do it on a Propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
Post Edited (Dgswaner) : 10/2/2007 2:29:48 PM GMT
Purpose: I want to make a Web LCD Display for my PINK, to display sensor readouts. I've made the LCD digit images 0-9. So if a temp sensor reads 123 deg, the pink would hold 3 values 1, 2, 3, in 3 different variables. and would use those values to display 1.jpg, 2.jpg, 3.jpg. and the images would change as the values change.
is DIG the best command for this. running through a for next loop incrementing the dig value and PINK variable, I kinda want a catch all app where I don't have to worry about number lengths and would like to have the possibility of alpha numeric also. Just want to get some input before I go the long way around the mountain.
I would actually like this to be handled on the PINK in html or Java script so I don't have to use up 2+ variables for every input. but that's beyond my limits.
your input is appreciated. and I'll post my full code and images once it's working... I need to fix some of the images also.
thanks
added:
this is for a BS2SX and eventually I'll want to do it on a Propeller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
Post Edited (Dgswaner) : 10/2/2007 2:29:48 PM GMT
Comments
why is the counting is skipping? the BS2 and the refresh rate are set to 1 sec. and don't sync, add a bit of lag and you have skipping.
My images aren't on the pink to save space so you'll need to change URL for the images. If you want to use the code on your own pink.
the DIG command works pretty good but I haven't really looked into what happens if you DIG past the length of a number.
Comments are more than welcome. I have plans to make a 4x16 alpha numeric display but I'm going to wait on that one.
I'd love input on how to refresh the images with AJAX or how to separate the digits in HTML or JAVA.
Oh ya the code!
Added the blue text
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
Post Edited (Dgswaner) : 10/2/2007 6:20:51 PM GMT
I personally havn't replied as i didn't know the solution, but I do like the graphics you designed they are very lifelike, and i like the demo, although i didn't have to change the URL or anything to get it to run i just clicked on your link.
Keep up the good work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
You may be asking "Why use the inefficient string?". The reason is that some people may want to use other characters too (like hex or something). By using javascript strings, you get ultimate flexibility. In fact, it may be even more efficient then numbers if your browser stores strings as an array of chars. Not to mention you don't have to worry about overflowing any integers and such.
EDIT: Added missing quotation.
Harrison
Post Edited (Harrison.) : 10/2/2007 7:39:32 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster