I’m just running tests with Blynk - I have bluetooth working and can switch LEDs on and off etc
The next step was to read a voltage on GPIO 2 -
The problem I’ve got is that the result of the code below is always 4095 output. It seems that the analogue read always returns 4095
If I comment out the lines Blynk.begin and Blynk.run I get the output I expect.
I obviously don’t understand something - I need the anaolgue pin value in my code for control later but when Blynk is running I don’t appear to be able to get any value other than 4095
#define BLYNK_PRINT Serial
#define BLYNK_USE_DIRECT_CONNECT
#include <BlynkSimpleEsp32_BT.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "........riqfV";
WidgetLCD lcd(V1);
const int TPin = 2;
int TempReading = 0;
void setup()
{
// Debug console
Serial.begin(115200);
Serial.println("Waiting for connections...");
Blynk.setDeviceName("HotTub");
Blynk.begin(auth);
}
void loop()
{
Blynk.run();
TempReading = analogRead(TPin);
Serial.println(TempReading);
delay(500);
}