mistergreen wrote:On the Arduino you can pin map like so
Code: Select all
pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH);
Since there are so many analog input pins, it would be good to convert it to a digital pin. I've tried this but it doesn't work for the ESP32.
Is this still in the works or it isn't possible?
if you use the right board, it os possible, some boards 37,38 is not breakout for reason
do you want use it as OUTPUT digital or INPUT digital?
some pins need extra knowledge example 37,38
but this is done in the arduino ide
example was:
Code: Select all
#include <driver/adc.h>
void setup() {
Serial.begin(115200);
adc1_config_width(ADC_WIDTH_12Bit);
adc1_config_channel_atten(ADC1_CHANNEL_1, ADC_ATTEN_6db);//channel_1 for GPIO37 and 2 for 38.
}
void loop() {
int value = adc1_get_voltage(ADC1_CHANNEL_1);
Serial.println(value);
delay(1000);
}
note, that 37,38
have exta HDK Low-Noise Amplifier in this version under 28.4 ( can be changed in next version )
best wishes
rudi