Hello World with a wifly module (RN 131 C/G - RN-XV)

Dependencies:   mbed WiflyInterface

Committer:
samux
Date:
Fri Aug 24 13:52:40 2012 +0000
Revision:
5:867d16e948eb
Parent:
4:fd030db1a6f4
use mbed_official WiflyInterface

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() {
samux 3:3b84102f022e 17 wifly.init(); // use DHCP
samux 3:3b84102f022e 18 while (!wifly.connect()); // join the network
samux 3:3b84102f022e 19 printf("IP Address is %s\n\r", wifly.getIPAddress());
samux 5:867d16e948eb 20 wifly.disconnect();
samux 1:49e1e9ed6e39 21 }