Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

ESP32 ADCs won't enable in js

I am trying to read any channel of the ESP32's ADC. Does the "pin" refer to the ESP32 pin number or the GPIO number? In any case, I can't seem to get any ADC channel to enable, as follows. No matter what "pin" is selected, the ADC.enable(pin) always returns 0. Is there some adjustment that must be made to mos.yml or conf0.json? Has any one got experience with ESP32's ADCs. Thanks for your help. JSW


let fooo=ADC.enable(20);
let gooo=ADC.enable(21);
let hooo=ADC.enable(22);
let iooo=ADC.enable(23);
let jooo=ADC.enable(24);

let fooo=ADC.enable(25);
let gooo=ADC.enable(26);
let hooo=ADC.enable(27);
let iooo=ADC.enable(28);
let jooo=ADC.enable(29);

let fooo=ADC.enable(10);
let gooo=ADC.enable(11);
let hooo=ADC.enable(12);
let iooo=ADC.enable(13);
let jooo=ADC.enable(14);
let fooo=ADC.enable(15);
let gooo=ADC.enable(16);
let hooo=ADC.enable(17);
let iooo=ADC.enable(18);
let jooo=ADC.enable(19);

let getInfo = function() {
return JSON.stringify({
total_ram: Sys.total_ram(),
free_ram: Sys.free_ram()

let time0=Timer.set(3000, Timer.REPEAT, function() {
print(fooo,gooo,hooo,iooo,jooo,'Tick', 'uptime:', Sys.uptime(), getInfo());}, null);


Sign In or Register to comment.