View Full Version : graph led with 10 segments
Badger
08-21-2008, 08:12 PM
Hello
is there any ware in nuts and bolds that shows a person how to set up an led that shows like a bar graph.
please let me know at this moment dont have time to search need to go to dayton ohio for doc appt. 90 min drive
Phil
Hook 10 LEDs up to 10 pins of a Stamp. Use 470 ohm resistors and put 5 resistors on one port and 5 on the other (so you don't have too many LEDs pulling current through the Stamp on one port).
Now you can light 10 leds and do what you want -- which is what? Are you displaying readings from a sensor of some kind, e.g. sound levels, battery charge, tach, what? Just doing cool LED patterns?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php (http://1uffakind.com/robots/povBitMapBuilder.php)
1uffakind.com/robots/resistorLadder.php (http://1uffakind.com/robots/resistorLadder.php)
Badger
08-22-2008, 05:34 AM
Hello Zoot
thanks for the info. but i dont quite understand about the resistors all being on 2 ports. do you mean like if i put on port 1 to 10 i would put 5 resisters on port 1 and 5 resistors on port 10 .. sorry i am a newbie and i a trying hard so please be patient with me.
Badger
A port is a "group" of pins -- on the stamp there are two ports -- pins0-7 and pins8-15. Basically you don't want to draw too much current through one group or the other at the same time AND you don't want to draw too much current through all pins all together either.
pin resistor (330-470) LED
==>---------------\/\/\/------------<|----------( battery minus)
For every LED. Then you can turn them on and off by making all the pins outputs and changing OUTL and OUTH (this lets you set all leds at once).
Say you have 5 leds on pins 0-4 and another 5 on pins 8-12 with resistors on all of them.
LedsLeft = OUTL
LedsRight = OUTH
DIRL = %11111111 ' make all pins outputs 0-7
DIRH = %11111111 ' make all pins outputs 8-15
Turn_On_all:
LedsLeft = %00011111 ' remember no leds on pins 5,6,7
PAUSE 1000
LedsRight = %00011111 ' other 5
PAUSE 1000
Turn_On_EveryOtherOne:
LedsLeft = %00010101 ' remember no leds on pins 5,6,7
PAUSE 1000
LedsRight = %00001010 ' other 5
PAUSE 1000
END
Reading the sections in the Pbasic Manual about DIRS, OUTS, INS will help. Plus there are a number of good examples about hooking up an LED so you don't pull too much current through your Stamp.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php (http://1uffakind.com/robots/povBitMapBuilder.php)
1uffakind.com/robots/resistorLadder.php (http://1uffakind.com/robots/resistorLadder.php)
Badger
08-22-2008, 07:00 AM
Hello Zoot
thanks for the detailed explanation that is really nice.. i am doing this on my own from scratch by reading things as fast as i can. I will review that pbasic manual as you suggested and observe the grouping of pins as you explained..
again thanks and have a good eve..
if i have anymore questions i will post them and see what comes back my way
Bad Badger