Created
January 4, 2019 14:44
-
-
Save daniel-frenkel/09f10ddde49acfa74a6af26a37e509d3 to your computer and use it in GitHub Desktop.
Arduino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Comment this out to disable prints and save space */ | |
#define BLYNK_PRINT Serial | |
#include <WiFi.h> | |
#include <WiFiClient.h> | |
#include <BlynkSimpleEsp32.h> | |
int LED = 5; | |
// You should get Auth Token in the Blynk App. | |
// Go to the Project Settings (nut icon). | |
char auth[] = "AUTH TOKEN"; | |
// Your WiFi credentials. | |
// Set password to "" for open networks. | |
char ssid[] = "WiFi"; | |
char pass[] = "Password"; | |
BLYNK_WRITE(V1) { | |
if(param.asInt()!=0){ | |
digitalWrite(LED, HIGH); | |
} | |
else{ | |
digitalWrite(LED, LOW); | |
} | |
} | |
void setup() | |
{ | |
// Debug console | |
Serial.begin(9600); | |
pinMode(LED,OUTPUT); | |
// Uncomment below to use a personal Server | |
// Blynk.begin(auth, ssid, pass,"your_server"); | |
// Use this if running on Blynk Server | |
Blynk.begin(auth, ssid, pass); | |
} | |
void loop() | |
{ | |
Blynk.run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment