Étape 3: codage!!
#define BLYNK_PRINT Serial / / commenter cela
#include
#include
Objet de jeu de série ESP8266
#define EspSerial Serial1
Cela peut être un objet de SoftwareSerial (revois
#include
SoftwareSerial EspSerial(2, 3) ; RX, TX
ESP8266 wifi(EspSerial) ;
Vous devriez obtenir le jeton d’authentification dans l’application de Blynk
Accédez aux paramètres projet (icône de l’écrou).
Char [auth] = "YourAuthToken" ;
void setup()
{
Serial.Begin(9600) ; Jeu console baud
Delay(10) ;
EspSerial.begin(9600) ; Set ESP8266 baud
Delay(10) ;
Blynk.Begin (auth, wifi, « ssid », "pass") ;
}
void loop()
{
Blynk.Run() ;
}