基于ESP32的Blinker控制四路继电器连接RYG灯和白灯+蜂鸣器
硬件:
ESP32
四路继电器
RYG灯
白灯
有源蜂鸣器
软件:
Arduino平台的ESP32开发板IDE
Blinker.apk
电路连接:
外接电源:电脑USB转串口,只用5V和GND同时和ESP32共地,通过面包板,同时给继电器供电,继电器,ESP32电源共地
ESP32:继电器:RYG-白灯+有源蜂鸣器
12:IN1:R
13:IN2:Y
2:IN3:G
4:IN4:白灯+有源蜂鸣器
代码:
/* ******************************************************************* Download latest Blinker library here:* https://github.com/blinker-iot/blinker-library/archive/master.zip* * * Blinker is a cross-hardware, cross-platform solution for the IoT. * It provides APP, device and server support, * and uses public cloud services for data transmission and storage.* It can be used in smart home, data monitoring and other fields * to help users build Internet of Things project