Shop OBEX P1 Docs P2 Docs Learn Events
LED's Fade in and Out — Parallax Forums

LED's Fade in and Out

romanjcgromanjcg Posts: 1
edited 2008-02-01 05:28 in BASIC Stamp
Hello I was trying to get the LED's on my boe-bot to fade in and out. The HIGH LOW command is a basic on/off switch which is not what I'm looking for. I tried to use the command (PULSOUT) that turns the wheels (servos) at different speeds but it didn't work at all. Has anyone ever faded an LED in or out with the Basic stamp? If not, does anyone have any ideas? Thanks, Roman.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-01-31 21:30
    Try the PWM statement. Anything that will turn the LED on for some brief time, then turn it off for a brief time will work. You have to vary the proportion of on/off time and turn it on and off quickly enough so the eye will average the time.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-01-31 23:17
    The problem with doing this on the BOE-Bot is that the code is paused for 20ms every cycle through the loop. You’re going to need something like a PWMPAL or other co-processor to offload time to the LEDs. Alternatively you could use the ServoPAL to handle the servos so you could implement this. It would require changing the flow of the code though. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-01-31 23:25
    Why don't you use a digital ptentiometer.

    Technic-R-C
  • ColtColt Posts: 24
    edited 2008-02-01 05:28
    ·· A digital pot would work great, if you stopped all the other processes while the stamp controls the digital pot. If you used a co-processor, it could control the led while the boe-bot was doing other tasks.. Such as moving forward, or taking sensor measurements... Until you wanted to change the rate the LED fades or other functions, because the stamp would have to stop other processes while sending the new signals to the PWMPal ( or which ever you choose to use ).

    This is how I understand it, I havnt ran into that situation yet..
Sign In or Register to comment.