fading leds?
meredth78
Posts: 18
·I am trying to get an led to fade. I have done·it with the BS2, but I cant get it to work with the SX.
BS2:· ---WORKS---
·· ········ FOR pulsecount = 1 TO 255
··········· PWM led2, 255 - pulsecount, 3
··········· NEXT
SX/B: ---NOT WORKING---
··········· FOR pulsecount = 1 TO 255 step 5
··········· PWM led2, 255 - pulsecount
············NEXT
HELP
-meredth78
Post Edited (meredth78) : 4/20/2006 5:01:40 AM GMT
BS2:· ---WORKS---
·· ········ FOR pulsecount = 1 TO 255
··········· PWM led2, 255 - pulsecount, 3
··········· NEXT
SX/B: ---NOT WORKING---
··········· FOR pulsecount = 1 TO 255 step 5
··········· PWM led2, 255 - pulsecount
············NEXT
HELP
-meredth78
Post Edited (meredth78) : 4/20/2006 5:01:40 AM GMT
Comments
You cannot use math in the SX/B PWM command.
You can do it this way...
FOR pulseCount = 255 TO 1 STEP -5
· PWM led2, pulseCount, 3
NEXT
SX/B is taking 255 as the duty and pulseCount as the duration.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module"·available from Parallax for only $28.95 http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module"·available from Parallax for only·$49.95 http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Available now! Cheap 4-digit LED display with driver IC·www.hc4led.com
"I reject your reality, and substitute my own." Mythbusters
·
Post Edited (meredth78) : 4/20/2006 10:34:29 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (meredth78) : 4/20/2006 11:12:28 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax