.

Dependencies:   WiflyInterface mbed

Fork of Wifly_HelloWorld by Samuel Mokrani

main.cpp

Committer:
brianconnett
Date:
2014-09-04
Revision:
6:ac83753de2a6
Parent:
5:867d16e948eb

File content as of revision 6:ac83753de2a6:

#include "mbed.h"
#include "WiflyInterface.h"

Serial pc(USBTX, USBRX);

/* wifly object where:
*     - p9 and p10 are for the serial communication
*     - p25 is for the reset pin
*     - p26 is for the connection status
*     - "mbed" is the ssid of the network
*     - "password" is the password
*     - WPA is the security
*/
WiflyInterface wifly(p9, p10, p25, p26, "mbed", "password", WPA);

int main() {
pc.baud(921600);
    wifly.init(); // use DHCP
    while (!wifly.connect()); // join the network
    printf("IP Address is %s\n\r", wifly.getIPAddress());
    wifly.disconnect();
}