LED PWN dimming help:..
KapteinFredrik (norway)
Posts: 17
Hi. Last night i made a LED light box something........It has 9 small "rooms" with LEds in. Therefore I need a way to program it..... Now i use pin 8-15 with binary codes. How do i dim/fade(PWN?) the leds in and out to make different pattern?
Sorry for my english..
Kaptein Fredrik
Sorry for my english..
Kaptein Fredrik
Comments
What stamp are you using?
This isn't hard to do.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___···························· BoogerWoods, FL. USA
KapteinFredrik
Post Edited (KapteinFredrik (norway)) : 3/25/2010 5:36:22 PM GMT
You'll have to get Wikipedia to explain it, but by varying the amount of time you turn ON the LED, you can dim the light.
Look at your Basic manual v2.2, page 347 gives the description of PULSOUT:
PULSOUT Pin, Duration
Function
Generate a pulse on Pin with a width of Duration.
• Pin is a variable/constant/expression (0 – 15) that specifies the I/O
pin to use. This pin will be set to output mode.
• Duration is a variable/constant/expression (0 – 65535) that specifies
the duration of the pulse. The unit of time for Duration is described
in Table 5.84.
There's a table in there as well.
So you'd:
main:
PULSEOUT pin, and some duration
PAUSE 16
GOTO main
pin = whatever output your LED is on
duration = length of time the output is HIGH
PAUSE 16 = do nothing for 16ms.... This command sets your frequency or how many times a second we do the PULSOUT
You'll need to play with the values of PAUSE and duration, but that's about it!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... Smile, there went another one.
Time for spoon-feeding?· OK, open wide -- http://forums.parallax.com/showthread.php?p=850777
OOOOOOoooooo. lovely! VERY NICE!
I'll stag your code. Ya' never know when it might be useful in..... I dunno, writing an article for Nuts & Volts [noparse]:)[/noparse]
Just kidding.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... Smile, there went another one.
How do i program it with some LED's to make a "dragontail"
And how do i program it to do www.youtube.com/watch?v=OUpNYQgWRtM&NR=1
How do i program it with some LEDs to make a Dragontail www.youtube.com/watch?v=uGqwblE0MGY&feature=related
Post Edit:
In case you missed the hotlink/s -- http://forums.parallax.com/showthread.php?p=778772
Modify to set any LED brightness. Uses PWM Pulse Width Modulation.
No dropping resistor used.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
humanoido
*Stamp SEED Supercomputer *Basic Stamp Supercomputer *TriCore Stamp Supercomputer
*Minuscule Stamp Supercomputer *Tiny Stamp Supercomputer *Penguin with 12 Brains
*BASIC Stamp Supercomputing Book *Three Dimensional Computer *StampOne News!
*Penguin Tech *Penguin Robot Society *Toddler Humanoid Robot Project
*Ultimate List Prop Languages *Prop-a-Lot *Propalot Stuff *Prop SC Computer
*Prop IB Hypercomputer - under development *Hobby Space Program
The article about a red LED on a penguin robot has code and circuit to do what you want.
humanoido
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
humanoido
*Stamp SEED Supercomputer *Basic Stamp Supercomputer *TriCore Stamp Supercomputer
*Minuscule Stamp Supercomputer *Tiny Stamp Supercomputer *Penguin with 12 Brains
*BASIC Stamp Supercomputing Book *Three Dimensional Computer *StampOne News!
*Penguin Tech *Penguin Robot Society *Toddler Humanoid Robot Project
*Ultimate List Prop Languages *Prop-a-Lot *Propalot Stuff *Prop SC Computer
*Prop IB Hypercomputer - under development *Hobby Space Program