Fork me on GitHub


This library provides ADC API which allows to read data from the analog input.

C API Reference mgos_adc.h

#include "mgos_adc.h"

See on GitHub: mgos_adc.h, mgos_adc.c

bool mgos_adc_enable(int pin);

Configure and enable ADC

int mgos_adc_read(int pin);

Read from the analog pin

JAVASCRIPT API Reference api_adc.js



Configure and enable ADC for a pin, return 1 if success, 0 otherwise.

Read pin analog value, return an integer.