Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 /*----------------------------------------------------- 00002 File Name : main.cpp 00003 Purpose : For esp8266 mbed porting 00004 Creation Date : 22-06-2017 00005 Last Modified : 00006 Created By : Jeasine Ma [jeasinema[at]gmail[dot]com] 00007 -----------------------------------------------------*/ 00008 #include <cstdarg> 00009 #include <cstring> 00010 #include "mbed.h" 00011 #include "esp8266.h" 00012 00013 00014 Serial ser2usb(USBTX, USBRX); 00015 00016 int main(void) { 00017 Esp8266 client(0); 00018 client.connect_mqtt_broker("tdxls-iot.xicp.net"); 00019 ser2usb.printf("Initialization done.\r\n"); 00020 00021 while(1) { 00022 client.publish("/smartcar", "awesome smartcar!"); 00023 client.publish("/smartcar", "awesome smartcar!"); 00024 wait(1); 00025 //char buf[32]; 00026 //client.subscribe_poll("/icenter", buf, 32); 00027 //ser2esp8266.attach(simple_callback, Serial::RxIrq); 00028 //ser2usb.printf("%s\r\n", esp_paramBuf); 00029 //ser2usb.printf("loop\r\n"); 00030 //ser2usb.printf("haha\n"); 00031 //while(1); 00032 } 00033 }
Generated on Mon Aug 1 2022 22:01:32 by
1.7.2