it gives warning [202] argument out of range Least significant bits used
it gives warning [202] argument out of range Least significant bits used
from the manual
8 bits = byte, max value = 255Code:The LOOKUP statement can be used to retrieve values from a table of 8-bit constants.
so you need to use 2 LOOKUP2 table
split your lookup table in two, duplicate your code and your ready to go.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Perhaps something like this ...Code:Freq var word say var byte countera var byte PlayButton var PORTB.7 SoundOut var PORTA.0 loop: If PlayButton = 0 THEN For countera = 0 to 70 ; Siren UP Gosub PlayTone if PlayButton = 1 then ButtonUp Next countera For countera = 69 to 1 step -1 ; Siren Down Gosub PlayTone if PlayButton = 1 then ButtonUp Next countera endif ButtonUp: Pause 50 goto loop PlayTone: LOOKUP2 CounterA,[902,902,902,884,884,884,851,851,835,820,820,806,806,_ 792,778,765,752,740,740,716,716,705,705,683,683,653,663,663,644,635,_ 618,627,602,594,578,578,557,564,549,531,531,519,513,501,492,475,465,_ 465,456,442,434,422,414,406,389,389,373,373,352,334,329,318,307,296,_ 283,279,263,252,249,238,232],Freq For say=1 to 25 High SoundOut PauseUS Freq Low SoundOut PauseUS Freq Next say Return
DT
Thanks Darrel I have done slightly different way I will post it in few days may be usefull to some body
Yup, your right!
LOOKUP only works with byte sized values. Woops.
Time for a vacation. cyaz
<br>
DT
how make simple count from 902 to 232 with step -10 and back if button is pressed?
is there any way to save count? I mean if button pressed counter is counting the figures from table if button unpressed i want it to be saved some where and when button is pressed for second time i want the counting continue from the figure it stopped is it possible?
Bookmarks