ESP32 Analog pin not reading when bluetooth is connected

pravi.khm@gmail.com
Posts: 11
Joined: Sun Mar 31, 2019 1:31 am

ESP32 Analog pin not reading when bluetooth is connected

Postby pravi.khm@gmail.com » Wed Jul 10, 2019 6:37 am

Hi,

I have been using ESP32 and writing code in Arduino. However, when I enable Bluetooth, GPIO4 and GPIO15 does not work to read analog inputs. I have connected an IR LED's on both pins and reading analog signals. If Bluetooth code is not used, ESP32 is reading the analog signals and displaying it on serial monitor. If the below Bluetooth code is used, the reading is shown as 255 on both pins (reading 5v. Yes, they are 5v for now and will be level shifted to 3.3v).

Code: Untitled.c Select all


void init_bluetooth() {
ESP_BT.begin("EKA Robot"); //Name of your Bluetooth Signal
Serial.println("Bluetooth Device is Ready to Pair");
}
IR LED code :

Code: Untitled.c Select all


// Read Infrared LED on GPIO4. Similar function exists to read GPIO15
int readIR() {
int sensorValue = analogRead(oaPinL);
delay(5);
sensorValue = map(sensorValue, 0, 4095, 0, 255);
return (sensorValue);
}

Who is online

Users browsing this forum: No registered users and 2 guests