Skip to content

Instantly share code, notes, and snippets.

@suru-dissanaike
Created January 26, 2019 19:01
Show Gist options
  • Save suru-dissanaike/748a95fa1a7b2e426f857efa57bf0174 to your computer and use it in GitHub Desktop.
Save suru-dissanaike/748a95fa1a7b2e426f857efa57bf0174 to your computer and use it in GitHub Desktop.
Mongoose JavaScript example ADC driver
let MYADC = {
 cfg: ffi('int adc1_config_channel_atten(int, int)'), // that function must be in the SDK
};
let db6 = 2; // whatever the numeric value for 6 dB is 2
MYADC.cfg(pin, db6);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment