![]() ![]() ESP32 DOIT DEVKIT V1 Board (read Best ESP32 development boards).To see how everything ties together, we’ll make a simple example to read an analog value from a potentiometer.įor this example, you need the following parts: Read Analog Values from a Potentiometer with ESP32 There is a very good video explaining these functions that you can watch here. Get the result of the conversion: returns 16-bit integer. Check if conversion on the pin’s ADC bus is currently running (returns TRUE or FALSE). ![]() adcStart(pin), adcBusy(pin) and resultadcEnd(pin): starts an ADC convertion on attached pin’s bus.adcAttachPin(pin): Attach a pin to ADC (also clears any other analog mode that could be on).Attenuation values are the same from previous function. analogSetPinAttenuation(pin, attenuation): sets the input attenuation for the specified pin.ADC_11db: The input voltage of ADC will be attenuated, extending the range of measurement to up to approx.ADC_6db: The input voltage of ADC will be attenuated, extending the range of measurement to up to approx. ![]()
0 Comments
Leave a Reply. |