Have you tried the 'Select Case' statement yet? don't know if it'll save space...ya never know...
Have you tried the 'Select Case' statement yet? don't know if it'll save space...ya never know...
No the tones are not eveny spaced. Here are the required tones and associated value of the w1 variable.
CTCSS W1
1 67 14925
2 71.9 13908
3 77 12987
4 82.5 12121
5 88.5 11299
6 94.8 10549
7 100 10000
8 103.5 9662
9 107.2 9328
10 110.9 9017
11 114.8 8711
12 118.8 8418
13 123 8130
14 127.3 7855
15 131.8 7587
16 136.5 7326
17 141.3 7077
18 146.2 6840
19 151.4 6605
20 156.7 6382
21 162.2 6165
22 167.9 5956
23 173.8 5754
24 179.9 5559
25 186.2 5371
26 192.8 5187
27 203.5 4914
28 210.7 4746
29 218.1 4585
30 225.7 4431
31 233.6 4281
32 241.8 4136
33 250.3 3995
lookdown2 w0,>[14925,12987,12121,11299,10549,10000,9662,9328,9017 ,8711,8418,8130,7855,7587,7326,7077,6840,6605,6382 ,6165,5956,5754,5559,5371,5187,4914,4746,4585,4431 ,4281,4136,3995],b0
branchl b0 , [ t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33 ]
t1: do whatever with tone 1
t2: do whatever with tone 2
and so on and so on...
I'll let you know right now, this bit of code will still eat up a bunch of code space...
this would be good if the tone was extremely presice. I have allowed for variances up to half way between tones. can this also be done with the above example?
Probably not, 'cause that sounds like it involves 'fuzzy logic', the ability to change parameters in the middle of what you're doing, or something like that.
Maybe an extra if/then in each chunk of tone code checking for the 'exactness' of the tone?
You do understand the concept of the example above right?
If the value is above 14925 it'll jump to t1...and you're done...
if the value is 14925 or below, it'll skip the first one and try the second one...
If the value is above 12987 (but below or equal to 14925 'cause it checked it during the first check), it'll jump to t2...and you're done....
...and so on and so on and so on...
And you don't have to use the BRANCHL statement. Once you've got your index variable into B0, you can use the SELECT CASE statement to handle the individual blocks of code instead of a bunch of goto's.
thanks Skimask,
I did'nt see the ">" symbol.
Yes it does make sense and should work. I'll give it a go and let you know
Thanks Skimask
I modified my code to use lookdown2 and works great. Not using branch but sending the lookdown2 index out serialy. My code droped from approx 1500 words with only 1/2 of the tones covered to less than 500 words for the entire tone set.
Thanks again
Bookmarks