An archive of community.esquilo.io as of Saturday January 26, 2019.

Adc.resolution works when running, but not debugging

rb1

Test code:

local adc = ADC(0);
// Set resolution to 16 bit
adc.resolution(16);
local TEMP_ADC_CHANNEL = 2;

print(adc.readv(TEMP_ADC_CHANNEL) + "\n");

Without breakpoints, no errors are thrown. Put a breakpoint on "local adc = ADC(0);" and step through:

%%Runtime error [the index 'resolution' does not exist]

Scott_Shumate

Strange. I assume this is inside of a function? Does the backtrace window show the adc as an instance? I'll see if I can reproduce it.

rb1

Hi Scott,

This is at the top of my nut, which is called using "dofile" from the boot nut:

delay(300);
dofile("sd:/tanklevel.nut");

I do love the Esquilo. Once my nut is running it's fairly dependable. There are a lot of little nits that I'm sure will be resolved.

One unrelated issue; I got the protoshield and the larger case. I would like to upgrade from 0.30 to 0.31. But It was so difficult to get the shield on without bending the long pins that I'm afraid to take it off. And of course you can't get to the screws to remove the Esquilo from the case, nor can you reach the programming button with the case sides so high.

FYI, the Esquilo is active monitoring the cistern in my basement. It's hooked to a Maxbotix sonar sensor and an LM34 temperature chip to monitor tank level and pump temperature. I have a Beaglebone black with a 5" LCD screen in the kitchen.

I haven't quite finished the web interface yet (I need "Auto", and manual "On" and "Off" override buttons), but I've attached a photo so you an see.

After decades going from 8031/8051/8052 to Arduinos and PIs, I love the Esquilo best.

Regards,
Rick