ADCIN and LOOKUP ...
Hi, All
I was quietly ( LOL ) debugging Malc's Train controller and ... fell upon a little PbP BUG ... Yes,yes I did verify many times !!!
Which is this ( small ) BUG ???
I've used LOOKUP tables to correct a pot curve ( Log to Lin ... I must be crazy !!! )
So, I used a 8 Bits ADCIN ... and a Lookup table !!!
Calculated and Placed my ... 256 Values ( 0 -255 ...) into my lookup table ( I Know, ... manual whispers 255 !!! ) but no warning or errors when 256 values entered ... only when 257 !!!
What happens ??? Program just crashes ...
Solution ... use " ADC_RESULT MIN 254" before LOOKUP !!!
By the Time, I Also discovered ADCIN does not accept VAR Aliases ... only CON ones. Always had used ADCIN 0,1 or ...
Hope it will help someone not to lose too much hair...
Alain
PS: Malc !!! , Good news !!! Works more than Fine ...
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks