Shop OBEX P1 Docs P2 Docs Learn Events
Question about P1 Tachyon and RUNMOD - solved — Parallax Forums

Question about P1 Tachyon and RUNMOD - solved

Christof Eb.Christof Eb. Posts: 1,198
edited 2021-07-25 15:45 in Propeller 1

Hi,
when I start showtime in the console cog this works. But not, if I try to start it in a different cog. I can see that oldtime# is updated, so the code is active but there is no output WS2812. I suppose this has to do with [WS2812] and RUNMOD
What do I have to do?
Thanks! Christof

\ neopixA.fth
\ drive a neopixel ring with 12 leds as a clock face

1 RGBPIN

12 3 * bytes ledarray

: clrall
    12 3 * FOR 0 ledarray I + C! NEXT
    ledarray 12 RGBS ;

: setc ( color led -- ) \ 0 grn 1 red 2 blue
    3 * + ledarray + 1 SWAP C! \ set brightness 1 
    ledarray 12 RGBS ;

: clrled ( led -- ) \ 0 grn 1 red 2 blue
    3 * ledarray + 
    DUP 0 SWAP C! 
    DUP 1+ 0 SWAP C! 
    2 + 0 SWAP C! 
    ledarray 12 RGBS ;

{
: spinled 
    120 FOR 
        1 I 12 MOD setc 
        100 ms
        clrall
        1 ms
    NEXT ;
}

: ledtime 
    clrall
    TIME@ HMS
    1 ms 12 MOD 1 SWAP setc \ hours red
    1 ms 5 / 0 SWAP setc \ minutes green
    1 ms 5 / 2 SWAP setc \ seconds blue
;

long oldtime#

: showtime 
    BEGIN
    oldtime# @ TIME@ <> IF
        TIME@ oldtime# !
        ledtime
    THEN
    AGAIN
;

171500 TIME! 
\ ' showtime 5 RUN

Comments

Sign In or Register to comment.