This time, we use the combination of blynk app + server (local) + zero-knowledge ESP8266 development board to control the RGB LED to display various colors through the mobile phone APP.
1. Hardware preparation
(1) Zero-knowledge ESP8266 development board
(2) RGB LED
(3) Several DuPont lines
2. Circuit connection
The wiring is very simple, corresponding to R-D5, G-D6, B-D7, which corresponds to the pin settings of the controls in the Blynk app:
3. Mobile APP
For detailed description of mobile APP and Blynk, please refer to: http://www.lingzhilab.com/bbs/index/showonepostz?pid=356
4. Software
(1) Mobile phone
Create a new project using Blynk, select the device NodeMCU or ESP8266, and then add the ZERGBA control as follows:
(2) The ESP8266 end is as follows:
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xx";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xx";
char pass[] = "xx";
char local_domain[] = "192.168.0.111";
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, local_domain,8080);
}
void loop()
{
Blynk.run();
}
The above code only requires you to fill in your own TOKEN, wifi hotspot name and password.
5. Test verification
(1) In the Zero-Knowledge Development Tool, open the serial port debugging window and see the following information:
This indicates that we have successfully communicated with the server.
(2) On the Blynk app on your phone, click the Run button to start running. Then you can control the RGB LED to display various colors:
More detailed information can be obtained for free on the official website of Zero Knowledge Laboratory.
This content is originally created by EEWORLD forum user roc2 . If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source