Hello, I’m coming to this site to ask for help with my problem that i’m struggeling for hours. I would like to:
- Change the value of V5 pin by button in Blynk app
- Check if value equales 1
- If yes, run serial comunication with arduino (and rest will be done on arduiono)
And here comes my problem: if i break code on parts: Blynk to node, node to arduino, it works, but when i put it togheter it can’t work. I would really appreciate if someone could help me.
- Notes:
*NodeMCU comunicates with arduino using function used in this code
- Blynk app can change the value of V5, i have checked it by println(pinValue); and serial monitor
- When that code is uploaded it seems that Blynk app loose conettion after a while
- Hardware:
- Arduino Uno
- NodeMCU v3, ESP12-E
- Code:
#include<SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>SoftwareSerial s(3,1);
char auth = “kkk”;
char ssid = “xxx”;
char pass = “yyy”;void setup()
{
// s.begin(9600);
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
}
BLYNK_WRITE(V5)
{
int pinValue = param.asInt();
if (pinValue == 1)
{
transmit();
}
}
void loop() {
Blynk.run();
}void transmit()
{
s.write(123);
delay(1000);
}