Bs2 led pwm dim aok
![erco](https://forums.parallax.com/uploads/userpics/032/nK79TF2YS9C2I.jpg)
That's all the 3-letter acronyms I could muster...
Someone on another forum was asking about PWMing some LEDs, so I just had to bust out out my HW board and have a go at bit-banging pwm. Simple code is the best! I remember PJ was playing with this a while ago, now I see what all the fun was about. LED illumination isn't perfectly linear, so I had to play with the series resistor to get it to "look right". It looks better in person than on the video.
Someone on another forum was asking about PWMing some LEDs, so I just had to bust out out my HW board and have a go at bit-banging pwm. Simple code is the best! I remember PJ was playing with this a while ago, now I see what all the fun was about. LED illumination isn't perfectly linear, so I had to play with the series resistor to get it to "look right". It looks better in person than on the video.
' {$STAMP BS2} ' {$PBASIC 2.5} PAUSE 1000 B3=20 a:LOW 0:HIGH 2:LOW 4:HIGH 6 PAUSE 200 FOR B0=0 TO B3 B1=B3-B0 HIGH 0:LOW 2 :HIGH 4:LOW 6 PAUSE B0 LOW 0:HIGH 2:LOW 4:HIGH 6 PAUSE B1 NEXT HIGH 0:LOW 2 :HIGH 4:LOW 6 PAUSE 200 FOR B0=B3 TO 0 B1=B3-B0 HIGH 0:LOW 2 :HIGH 4:LOW 6 PAUSE B0 LOW 0:HIGH 2:LOW 4:HIGH 6 PAUSE B1 NEXT GOTO a
Comments
Oh, you meant the 144 LED guy...
Don't make me do it with a BS2... actually it would be pretty easy to program. Soldering the 144 LEDs would be the hardest part.
I just got a huge bag of low-current red LEDs, this might just work out.
-Phil
-P.