Test program for ESP8266

Dependencies:   MODSERIAL esp8266 mbed

Fork of esp8266test by Adhithya Rajasekaran

main.cpp

Committer:
adhithyan15
Date:
2015-05-01
Revision:
1:87002f9b898d
Parent:
0:a6e6cf82c329

File content as of revision 1:87002f9b898d:

#include "mbed.h"
#include "esp8266.h"
#include "MODSERIAL.h"

// Create a new MODSERIAL object with the pins used to interface
// ESP8266. I used p13 and p14. You can change it to any other 
// serial pins on the Mbed. 
MODSERIAL wifi(p13,p14);

DigitalOut myled(LED1);

int main() {
    ESP8266 e(&wifi,"ssid","password"); // Pass in the address to the MODSERIAL interface
    // and the SSID of the Wifi network you want to communicate with and its
    // password. 
    while(e.checkConnection() == false){
      //   
    }
    
    printf("ESP8266 is connected to the wireless network!\n");
    
}