.

Dependencies:   WiflyInterface mbed

Fork of Wifly_HelloWorld by Samuel Mokrani

Committer:
brianconnett
Date:
Thu Sep 04 13:54:50 2014 +0000
Revision:
6:ac83753de2a6
Parent:
5:867d16e948eb
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
samux 0:90ba0f51aa64 1 #include "mbed.h"
samux 3:3b84102f022e 2 #include "WiflyInterface.h"
samux 1:49e1e9ed6e39 3
samux 1:49e1e9ed6e39 4 Serial pc(USBTX, USBRX);
samux 1:49e1e9ed6e39 5
samux 1:49e1e9ed6e39 6 /* wifly object where:
samux 1:49e1e9ed6e39 7 * - p9 and p10 are for the serial communication
samux 3:3b84102f022e 8 * - p25 is for the reset pin
samux 3:3b84102f022e 9 * - p26 is for the connection status
samux 1:49e1e9ed6e39 10 * - "mbed" is the ssid of the network
samux 1:49e1e9ed6e39 11 * - "password" is the password
samux 5:867d16e948eb 12 * - WPA is the security
samux 1:49e1e9ed6e39 13 */
samux 5:867d16e948eb 14 WiflyInterface wifly(p9, p10, p25, p26, "mbed", "password", WPA);
samux 0:90ba0f51aa64 15
samux 1:49e1e9ed6e39 16 int main() {
brianconnett 6:ac83753de2a6 17 pc.baud(921600);
samux 3:3b84102f022e 18 wifly.init(); // use DHCP
samux 3:3b84102f022e 19 while (!wifly.connect()); // join the network
samux 3:3b84102f022e 20 printf("IP Address is %s\n\r", wifly.getIPAddress());
samux 5:867d16e948eb 21 wifly.disconnect();
samux 1:49e1e9ed6e39 22 }