Shop OBEX P1 Docs P2 Docs Learn Events
bs2 candle — Parallax Forums

bs2 candle

Jayguy5000Jayguy5000 Posts: 139
edited 2007-07-15 23:00 in BASIC Stamp
I read an article once about a bs2 and some LEDs making the appearance of the LEd's flickering as if it were a candle. where can I find a complete how-to for this project?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.

Comments

  • xcqnudtxcqnudt Posts: 11
    edited 2007-07-15 03:54
    i think the book "what's a microprocessor?" can help u!
  • CCraigCCraig Posts: 163
    edited 2007-07-15 04:47
    I think there was a updated one, but I can't find it. The first one was a BS1 and is in Nuts & Volts # 126 on the download page.

    You should also look at www.efx-tek.com/topics/wickled.html


    HTH, Chris

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I'm not scared of your robot. I'm covered by Old Glory (youtube)

    Post Edited (CCraig) : 7/15/2007 4:53:38 AM GMT
  • ForrestForrest Posts: 1,341
    edited 2007-07-15 14:07
    Nuts & Volts #126 posted at Parallax has the updated schematic. This project is simple to build - I made it myself here http://forums.parallax.com/showthread.php?p=616628
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-07-15 23:00
    If you dont mind dedicating a BS2 solely to this task here's a code that works nicely.

    Use an LED connected to Pin 0 in series with a 220 ohm resisor (or 470 if you want your battery to last longer). If you need to drive multiple LED's use some NPN transistors and a second voltage supply.

    '·{$STAMP BS2}
    ' {$PBASIC 2.5}

    Ramp· VAR Byte
    speed VAR Byte
    x···· VAR Byte
    result VAR Word

    DO
    RANDOM result
    RAMP=RESULT.HIGHBYTE MIN 64

    RANDOM result
    speed=RESULT.HIGHNIB· MIN 1

    FOR x=32 TO ramp STEP speed
    · PWM 0,x,5
    NEXT

    RANDOM result
    speed=RESULT.HIGHNIB· MIN 1

    FOR x=ramp TO 32 STEP speed
    · PWM 0,x,1
    NEXT


    LOOP


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR

    Post Edited (TechnoRobbo) : 7/20/2007 1:59:08 AM GMT
Sign In or Register to comment.