Arduino: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 5: Line 5:
  Click the "Install" button.                      [Wait for the installation to finish]
  Click the "Install" button.                      [Wait for the installation to finish]
  Click the "Close" button.
  Click the "Close" button.
<source lang="cpp">
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "S1DnsyFZlCEzWYArOvA-szNpU_j5XHYb";
char ssid[] = "Academia";
char pass[] = "chorke";
BlynkTimer timer;
BLYNK_WRITE(V1) {
  int pinValue = param.asInt();
  digitalWrite(D0, pinValue);
  digitalWrite(D4, pinValue);
  digitalWrite(D5, pinValue);
  digitalWrite(D6, pinValue);
  digitalWrite(D7, pinValue);
}
void setup() {
  Blynk.begin(auth, ssid, pass);
  pinMode(D0, OUTPUT);
  pinMode(D4, OUTPUT);
  pinMode(D5, OUTPUT);
  pinMode(D6, OUTPUT);
  pinMode(D7, OUTPUT);
  digitalWrite(D5, LOW);
}
void loop(){
  //TODO
}
</source>


==References==
==References==

Revision as of 23:06, 13 March 2020

BlynkSimpleEsp8266

Sketch > Include Library > Manage Libraries      [Wait for the download to finish]
In the "Filter your search" field, type "blynk". [Press Enter]
Click on "Blynk by Volodymyr Shymanskyy".
Click the "Install" button.                      [Wait for the installation to finish]
Click the "Close" button.
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "S1DnsyFZlCEzWYArOvA-szNpU_j5XHYb";
char ssid[] = "Academia";
char pass[] = "chorke";

BlynkTimer timer;
BLYNK_WRITE(V1) {
  int pinValue = param.asInt();
  digitalWrite(D0, pinValue);
  digitalWrite(D4, pinValue);
  digitalWrite(D5, pinValue);
  digitalWrite(D6, pinValue);
  digitalWrite(D7, pinValue);
}

void setup() {
  Blynk.begin(auth, ssid, pass);
  pinMode(D0, OUTPUT);
  pinMode(D4, OUTPUT);
  pinMode(D5, OUTPUT);
  pinMode(D6, OUTPUT);
  pinMode(D7, OUTPUT);
  digitalWrite(D5, LOW);
}

void loop(){
  //TODO
}

References