Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ESP8266WiFi.h>
- #include <BlynkSimpleEsp8266.h>
- char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"; // On Sim
- int P0,P1;
- BLYNK_WRITE(V4){P0 = param.asInt();}
- BLYNK_WRITE(V1){P1 = param.asInt();analogWrite(14,P1);}
- void setup(){
- Blynk.begin(auth,"user","password",IPAddress(159,89,39,112),8442);
- pinMode(2,OUTPUT);pinMode(12,OUTPUT);pinMode(14,OUTPUT);
- }
- void loop(){
- if(!digitalRead(13)){
- Blynk.notify("You Press Key");
- }
- Blynk.run();
- Blynk.virtualWrite(V0,analogRead(A0));
- Blynk.virtualWrite(V5,P1);
- if (P0){
- digitalWrite(2,1);
- }
- else{
- digitalWrite(2,0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement