Hi all,
Can anyone confirm if there are any incompatibilities / issues with Blynk lib and current electron firmware (0.5.3)
I’ve tried loads of different things including new blynk app project from scratch and numerous tokens etc…
If I download my code to my photon code works fine. If I download same code to electron no data is coming through to my app. Is there anything I need to add in my code in addition to the standard requirements for photon?
Electron is talking OK to console and ubidots etc… so no issue with data plan etc…
Any assistance appreciated!
here is my code:
#include “blynk.h”
#define BLYNK_PRINT Serial
char auth = “xxxxxxxx”;
//Timer handler configuration
#include “SparkCorePolledTimer.h”
SparkCorePolledTimer updateTimer1(30000); //Timer1 (5 minutes) - remote poll
void OnTimer1(void);
//Local configuration
float TnkLvlPV_RAW = A0; //Raw signal data from field
float Tx01 = 0.0; //transmission tag #1 (actual level, scaled)
void setup () {
pinMode(TnkLvlPV_RAW,INPUT);
Blynk.begin(auth); //open connection and authenticate
Serial1.begin(115200); //initiate timer handler
updateTimer1.SetCallback(OnTimer1);
}
BLYNK_WRITE(V2) {
if (param.asInt() == 1) { //If virtual coil “V1” = true, output is on.
digitalWrite(stsLEDg,HIGH);
}
else { // otherwise, output os off.
digitalWrite(stsLEDg,LOW);
}
}
BLYNK_WRITE(V3) {
if (param.asInt() == 1) { //If virtual coil “V3” = true, output is on.
digitalWrite(stsLEDr,HIGH);
}
else { // otherwise, output os off.
digitalWrite(stsLEDr,LOW);
}
}
void loop() {
updateTimer1.Update();
Blynk.run();
}
}
void OnTimer1(void) { //Handler for the timer, will be called automatically
// Read alalogue value assigned to TAG “TankLevelPV_RAW”
Tx01 = analogRead(TnkLvlPV_RAW);
Tx01 = map(Tx01, 0, 4095, 0, 100); //scale raw value to 0-100 %
delay(100);
Blynk.virtualWrite(0, String(Tx01));
Particle.publish(“tint01”, String(Tx01) + " %");
}