Lookup - question on proper use.
                    I am trying to learn how to make tables for displaying lots of patterns in a bank of 16 LEDs.
In trying to follow the example in the Propeller manual (pages 138-139) I have written the following code, but it does not produce any output in my LEDs [0..15].
Can anyone spot what I am doing wrong? Is there a way to handle LOTS of data in a better table? I need to output 16 bits at a time.
Thanks in advance. Tom
                            In trying to follow the example in the Propeller manual (pages 138-139) I have written the following code, but it does not produce any output in my LEDs [0..15].
Can anyone spot what I am doing wrong? Is there a way to handle LOTS of data in a better table? I need to output 16 bits at a time.
Thanks in advance. Tom
PUB Setup
    dira[0..15]~~
    outa[0..15]~
PUB List  |  Index, Temp
         repeat Index from 1 to 2
            Temp := lookup(Index: %1100110011001100, %1010101010101010)
             outa[0..15] := Temp
             waitcnt(clkfreq *2 + cnt)   
                
                            
Comments
Defining your bitpatterns in a DAT section would also work:
Then you'd simply say:
repeat Index from 0 to 1 outa[0..15]:=patterns[Index] waitcnt(...I like the DAT concept better than using LOOKUP and found your kind suggestion to work just fine!
Take care - Tom.