![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Simple usage of wifi module ESP826601.
Diff: main.cpp
- Revision:
- 0:47830fe8d357
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 19 11:42:27 2020 +0000 @@ -0,0 +1,33 @@ +#include "mbed.h" +#include "ESP826601.h" + +Esp ESP; +DigitalOut myled(LED1); +Ticker tick; + +void readData(){ + myled = !myled; +} + +int main() { + tick.attach(&readData, 0.5); + + ESP.init(); + ESP.send("AT+CIFSR"); + ESP.waitResponse(); + ESP.send("AT+CIPMUX=1"); + ESP.waitResponse(); + ESP.send("AT+CIPSERVER=1,80"); + ESP.waitResponse(); + + tick.detach(); + myled = 0; + + while(1){ + ESP.waitConnection(); + ESP.send("Pozdrav od Zvonimira"); + ESP.closeConnection(); + } +} + +