Blynk

From Digipool-Wiki
Revision as of 18:02, 15 January 2021 by WikiSysop (Talk | contribs)

Jump to: navigation, search

Blynk-Pinout.jpg

Setup

  1. Install the Blynk App on your Phone
  2. Creat an Account and log in
  3. Scann the QR-Code
  4. Follow the steps
  5. If the App is connecting to your Blynk board, open WLAN-Setting and select the boards WLAN by hand

SparkFun-Tutorial


Sparkfun-Blynk-ESP8266 Onboard-NeoPixel

Auf dem Sparkfun-Blynk-ESP8266 Board befindet sich eine RGB LED, die sich sehr gut dazu eignen, um zum Beispiel deinen aktuellen Zustand anzuzeigen. Diese RGB LED vom Type WS2812 ist mit Pin 4 verdrahtet und kann über die Libary Adafruit_NeoPixel.h angesteuert werden.


Onboard-RGB-LED


Sparkfun-Blynk-Onboard-NeoPixel-2.jpg Sparkfun-Blynk-Onboard-NeoPixel-1.jpg Sparkfun-Blynk-Onboard-NeoPixel-3.jpg


// Sparkfun-Blynk-ESP8266 Onboard-NeoPixel Example

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <Adafruit_NeoPixel.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

#define PIN 4
int stripR = 0;
int stripG = 0;
int stripB = 0;
int stripL = 0;

Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);

BLYNK_WRITE(V1)
{
  stripR = param[0].asInt();
  stripG = param[1].asInt();
  stripB = param[2].asInt();
  showRGB();
}

BLYNK_WRITE(V2)
{
  stripL = 255 - param.asInt();
  showRGB();
}

void showRGB() {
  int r = stripR - stripL;
  if (r < 0) r = 0;
  int g = stripG - stripL;
  if (g < 0) g = 0;
  int b = stripB - stripL;
  if (b < 0) b = 0;

  strip.setPixelColor(0, strip.Color(r, g, b));
  strip.show();
}

void setup()
{
  // Debug console
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

  strip.begin();
  strip.show();
}

void loop()
{
  Blynk.run();
}


Sparkfun-Blynk-ESP8266 Simple-Pin-ON-OFF

... comming soon


Sparkfun-Blynk-ESP8266 Read Onboard-Button

... comming soon