#define BLYNK_USE_DIRECT_CONNECT
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleSerialBLE.h>
char auth[] = "YourAuthToken";
void setup()
{
DebugSerial.begin(9600); // Debug console
// Blynk will work through Serial
// 9600 is for HC-06. For HC-05 default speed is 38400
// Do not read or write this serial manually in your sketch
Serial.begin(38400);
Blynk.begin(Serial, auth);
}
void loop()
{
Blynk.run();
}
Ask Google how to read voltage on an Uno and add that to your sketch with BlynkTimer like in the PUSH_DATA example
*************************************************************/
#define BLYNK_USE_DIRECT_CONNECT
// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#define BLYNK_PRINT DebugSerial
#include <BlynkSimpleSerialBLE.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "d8e1181a229a42c591ec12f6fc63ef90";
BlynkTimer timer;
void myTimerEvent()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V0,analogRead(A0)*5.0/1023.0);
}
void setup()
{
// Debug console
DebugSerial.begin(9600);
pinMode(A0,INPUT);
// Blynk will work through Serial
// 9600 is for HC-06. For HC-05 default speed is 38400
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
timer.setInterval(1000L, myTimerEvent);
}
void loop()
{
Blynk.run();
timer.run();
}
You shouldn’t need this at all… the ADC pins are by design, inputs… setting this may affect how it normally works?
PS, My experience with BT has been sketchy for even simple things like reading analog pins… not sure if it is an issue in the library or not, but I sometimes add in this line to disable direct App/pin manipulation and rely strictly on virtual pins.
#define BLYNK_NO_BUILTIN // Disable built-in analog & digital pin operations