Introduction : Use esp8266 to connect to the lighting technology platform, and you can use Tmall Genie and Xiaoai voice control. There are relays, RGB lights, and photoresistors. Use ESP8266 to learn the data upload and distribution of lighting technology. Developed using Arduino IDE, it is easy to get started and you can quickly understand the use of the Internet of Things. ESP8266 can also be used to connect to other cloud platforms to implement IoT functions.
Website: https://www.jianshu.com/p/adc5e62bdf5f
Or https://www.jianshu.com/p/cb0274d612b5
1.在点灯文档中心——>快速开始——>esp8266-WiFi接入,找到
The first sample program of Dian Deng Technology, use the "Dian Deng blinker" APP, create a new one on the APP"btn-abc"名称按键即可实现使用按键控制esp12f模块自带led的开/关
Need to complete: 1. Create the key of the new device in Dian Deng APP, fill in the wifi name and password
char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";
#define BLINKER_PRINT Serial
#define BLINKER_WIFI
#include <Blinker.h>
char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";
// 新建组件对象
BlinkerButton Button1("btn-abc");
BlinkerNumber Number1("num-abc");
int counter = 0;
// 按下按键即会执行该函数
void button1_callback(const String & state) {
BLINKER_LOG("get button state: ", state);
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}
// 如果未绑定的组件被触发,则会执行其中内容
void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
counter++;
Number1.print(counter);
}
void setup() {
// 初始化串口
Serial.begin(115200);
#if defined(BLINKER_PRINT)
BLINKER_DEBUG.stream(BLINKER_PRINT);
#endif
// 初始化有LED的IO
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
// 初始化blinker
Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
Button1.attach(button1_callback);
}
void loop() {
Blinker.run();
}
2.在点灯文档中心——>设备端开发与SDK——>Arduino支持,可以找到
How to use the BlinkerRGB color component(1) Initialization, creating objects
#define RGB_1 "RGBKey"
BlinkerRGB RGB1(RGB_1);
(2) Callback function for processing RGB received data
void rgb1_callback(uint8_t r_value, uint8_t g_value,
uint8_t b_value, uint8_t bright_value)
{
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
BLINKER_LOG("R value: ", r_value);
BLINKER_LOG("G value: ", g_value);
BLINKER_LOG("B value: ", b_value);
BLINKER_LOG("Rrightness value: ", bright_value);
}
(3) Register the callback function in setup()
RGB1.attach(rgb1_callback);
3.在点灯文档中心——>项目实战——>温湿度计,可学到如何上传数据。
Please complete it yourself, please refer to the attachment C file
4.在点灯文档中心——>语音助手接入,可学到如何接入语音助手。
Please complete it yourself, please refer to the attachment C file
Summary: After completing these four steps, you can learn the basic data upload and distribution of the Dian Deng Technology IoT platform, and voice assistant access. The attached C file is the same code as the Arduino code, which implements lighting APP, LED control, relay control, RGB control, photoresistor value upload, and adds Xiao Ai to control the LED switch.
Outlook: After completing this, if you are interested in the Internet of Things, you can continue to add the button (GPIO0 button) distribution function. The Dian Deng Technology platform encapsulates the Internet of Things process, which is suitable for igniting students' interest in learning the Internet of Things. It is recommended that students who are interested in the Internet of Things continue to use this development board to learn other Internet of Things platforms. Suggestion: Ali Life IoT Platform (i.e. Ali Feiyan Platform) is very good. Alios things developed by Ali can quickly connect to Ali Feiyan Platform. Alios things address: https://github.com/alibaba/AliOS-Things/blob/rel_3.1.0/README-zh.md
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet