Test program for ESP8266

Dependencies:   MODSERIAL esp8266 mbed

Fork of esp8266test by Adhithya Rajasekaran

Committer:
adhithyan15
Date:
Fri May 01 15:27:10 2015 +0000
Revision:
1:87002f9b898d
Parent:
0:a6e6cf82c329
Updated Commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
adhithyan15 0:a6e6cf82c329 1 #include "mbed.h"
adhithyan15 0:a6e6cf82c329 2 #include "esp8266.h"
adhithyan15 0:a6e6cf82c329 3 #include "MODSERIAL.h"
adhithyan15 0:a6e6cf82c329 4
adhithyan15 0:a6e6cf82c329 5 // Create a new MODSERIAL object with the pins used to interface
adhithyan15 0:a6e6cf82c329 6 // ESP8266. I used p13 and p14. You can change it to any other
adhithyan15 0:a6e6cf82c329 7 // serial pins on the Mbed.
adhithyan15 0:a6e6cf82c329 8 MODSERIAL wifi(p13,p14);
adhithyan15 0:a6e6cf82c329 9
adhithyan15 0:a6e6cf82c329 10 DigitalOut myled(LED1);
adhithyan15 0:a6e6cf82c329 11
adhithyan15 0:a6e6cf82c329 12 int main() {
adhithyan15 1:87002f9b898d 13 ESP8266 e(&wifi,"ssid","password"); // Pass in the address to the MODSERIAL interface
adhithyan15 0:a6e6cf82c329 14 // and the SSID of the Wifi network you want to communicate with and its
adhithyan15 0:a6e6cf82c329 15 // password.
adhithyan15 0:a6e6cf82c329 16 while(e.checkConnection() == false){
adhithyan15 0:a6e6cf82c329 17 //
adhithyan15 0:a6e6cf82c329 18 }
adhithyan15 0:a6e6cf82c329 19
adhithyan15 0:a6e6cf82c329 20 printf("ESP8266 is connected to the wireless network!\n");
adhithyan15 0:a6e6cf82c329 21
adhithyan15 0:a6e6cf82c329 22 }