Skip to content

Instantly share code, notes, and snippets.

@suru-dissanaike
Created January 26, 2019 19:00
Show Gist options
  • Save suru-dissanaike/98c286d44e3bbce2adf94d7f786c1ff9 to your computer and use it in GitHub Desktop.
Save suru-dissanaike/98c286d44e3bbce2adf94d7f786c1ff9 to your computer and use it in GitHub Desktop.
mgos_adc_enable
bool mgos_adc_enable(int pin) {
 struct esp32_adc_channel_info *ci = esp32_adc_get_channel_info(pin);
 if (ci == NULL) return false;
/* TODO(rojer): Allow changing? */
 ci->atten = ADC_ATTEN_11db;
return esp32_update_channel_settings(ci);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment