I need to chop down the values coming from the A/D (8 bit) into a certain amount of steps, in this case, creating the values 0 - 30 in 10 steps from the A/D's 0 - 255. Is this a good method or would you go about it a different way?
Anobium. In gcb, tables work faster than I thought they would. I was surprised. I thought arrays would be needed.
I haven't used "old" select case yet. I thought there would be an overhead but guess it's all optimised.
quote The new select case using range?
ps looking back at forum stuff about tables created at compile time. My lack of flash mem knowledge ie program code. lots of it and tables are in program flash memeory area so 32K flash mem allows one big table as best way to access parts in gcb and you can still write a big program.
What I'm trying to say is "where are tables explained more in gcb than in help" cos I use them a lot now.
Again I could have used case to use individual tables but the overhead, when a pointer works ok.
fast is better?
Last edit: stan cartwright 2017-11-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to chop down the values coming from the A/D (8 bit) into a certain amount of steps, in this case, creating the values 0 - 30 in 10 steps from the A/D's 0 - 255. Is this a good method or would you go about it a different way?
You could try
Which is faster? than * 3
The new select case using range?
A lookup table of 255 numbers 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2 etc.
joe. why? :) speed? multiples of 2 can be done with rotate/shift. odd numbers and the math is more work to process.
new project?
Anobium. In gcb, tables work faster than I thought they would. I was surprised. I thought arrays would be needed.
I haven't used "old" select case yet. I thought there would be an overhead but guess it's all optimised.
quote The new select case using range?
ps looking back at forum stuff about tables created at compile time. My lack of flash mem knowledge ie program code. lots of it and tables are in program flash memeory area so 32K flash mem allows one big table as best way to access parts in gcb and you can still write a big program.
What I'm trying to say is "where are tables explained more in gcb than in help" cos I use them a lot now.
Again I could have used case to use individual tables but the overhead, when a pointer works ok.
fast is better?
Last edit: stan cartwright 2017-11-29
@Stan. Read the Help... Select Case...