Wifi module configuration for GR_Peach
Dependencies: mbed
Diff: Wifi.cpp
- Revision:
- 0:7d24b78f9a5e
- Child:
- 1:e5ef21ebff5f
diff -r 000000000000 -r 7d24b78f9a5e Wifi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Wifi.cpp Tue Dec 06 05:13:39 2016 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" + +DigitalOut led1(LED1); +DigitalOut led2(LED2); +uint8_t data; +uint8_t wifi_ack; +Serial pc(USBTX, USBRX); +Serial Wifi(P2_14,P2_15); + +void call() { + // Note: you need to actually read from the serial to clear the RX interrupt + data = pc.getc(); + printf("%c\n", data); + led2 = !led2; +} + +int main() { + + //pc.attach(&call); + Wifi.baud(9600); + Wifi.printf("AT"); + wifi_ack = Wifi.getc(); + pc.printf("%s\n", wifi_ack); + } \ No newline at end of file