Wifi controlled robot that uses ESP8266 wifi chip.
Dependencies: Motordriver Servo mbed-dev mbed-rtos
Fork of ESP8266_wifi_robot by
Diff: ESP8266.h
- Revision:
- 0:df754b773321
diff -r 000000000000 -r df754b773321 ESP8266.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ESP8266.h Sat Oct 29 15:35:26 2016 +0000 @@ -0,0 +1,34 @@ +#ifndef ESP8266_H +#define ESP8266_H + +#include "mbed.h" + +#define SND_BUF_SIZE 1024 + +class ESP8266 +{ +private: + char _ssid[32]; + char _pwd[32]; + char _snd[SND_BUF_SIZE]; + RawSerial _esp; + DigitalOut _reset; + +public: + ESP8266(PinName tx, PinName rx, PinName reset, char * SSID, char * password); + void send(); + void send(char * command); + void setup(); + void reset(); + void baud(int baudrate); + void getMAC(); + void getIP(); + + int putc(int c); + int getc(); + int readable(); + int writeable(); + void attach(Callback< void()> func, SerialBase::IrqType type); +}; + +#endif \ No newline at end of file