QAQ ==!
Dependencies: mbed QEI-1 nRF24L01P xiugai
Diff: main.cpp
- Revision:
- 8:ec92c8510ece
- Parent:
- 7:6f8157c58241
- Child:
- 10:cda7ae2fc9de
--- a/main.cpp Thu Nov 07 06:31:09 2019 +0000 +++ b/main.cpp Fri Nov 08 00:52:35 2019 +0000 @@ -4,20 +4,15 @@ #include <string> typedef bool boolean; typedef std::string String; -#include "SYN6288.h" - -String str; - -Serial syn6288_Serial_2(PA_2,PA_3); +#include "esp8266.h" int main() { -for (int count = 0; count < 100; count++) { -str = "\xc4\xe3\xba\xc3"; -str += String("\xca\xc0\xbd\xe7"); -voice_play(str,&syn6288_Serial_2); -wait_ms(2000); -} +Esp8266 Esp8266client_(PB_6, PA_10, "iot_xxx", "12345678"); +const char* esp8266sensors_[][2] = {{"light",""},{"switch",""},{NULL,NULL}}; +const char* esp8266actuators_[][2] = {{"door",""},{"motor",""},{NULL,NULL}}; +Esp8266client_.connect_mqtt_broker("192.168.12.1", "node1", esp8266sensors_, esp8266actuators_); +Esp8266client_.publish_value("light", "0"); } \ No newline at end of file