I am trying to use D12 as a analog input on an ESP32 DevKit C board and I get this error, “Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled.”
This happens on all that Dx pins that according to the diagram support analog input.
The code is just a modified example:
import adc # import the adc module
#create a serial port stream with default parameters
i = 1
while i != 0:
#read the input on analog pin 0 sensor_value = adc.read(D12) #convert the analog reading (which goes from 0 - 4095.0) to a voltage (0 - 3.3V): voltage = sensor_value * (3.3 / 4095.0) #print out the raw and converted values: print("sensor raw value:", sensor_value,"Voltage:",voltage) sleep(300) print(i) i = i-1
What an I doing wrong? Is analog input only supprted on the Ax pins?