
wifi receive code
main.cpp@0:644275e48645, 2013-05-02 (annotated)
- Committer:
- hnoons
- Date:
- Thu May 02 10:23:05 2013 +0000
- Revision:
- 0:644275e48645
wifi receieve before pin
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hnoons | 0:644275e48645 | 1 | #include "mbed.h" |
hnoons | 0:644275e48645 | 2 | #include "TextLCD.h" |
hnoons | 0:644275e48645 | 3 | |
hnoons | 0:644275e48645 | 4 | Serial xbee1(p9, p10); |
hnoons | 0:644275e48645 | 5 | DigitalOut rst1(p11); |
hnoons | 0:644275e48645 | 6 | |
hnoons | 0:644275e48645 | 7 | DigitalOut myled(LED1); |
hnoons | 0:644275e48645 | 8 | DigitalOut myled2(LED2); |
hnoons | 0:644275e48645 | 9 | |
hnoons | 0:644275e48645 | 10 | TextLCD lcd(p15, p16, p17, p18, p19, p20); |
hnoons | 0:644275e48645 | 11 | |
hnoons | 0:644275e48645 | 12 | int main() { |
hnoons | 0:644275e48645 | 13 | rst1 = 0; //Set reset pin to 0 |
hnoons | 0:644275e48645 | 14 | myled = 0; |
hnoons | 0:644275e48645 | 15 | myled2= 0; |
hnoons | 0:644275e48645 | 16 | wait_ms(1); |
hnoons | 0:644275e48645 | 17 | rst1 = 1; //Set reset pin to 1 |
hnoons | 0:644275e48645 | 18 | wait_ms(1); |
hnoons | 0:644275e48645 | 19 | |
hnoons | 0:644275e48645 | 20 | lcd.printf("starting\n"); |
hnoons | 0:644275e48645 | 21 | wait(2); |
hnoons | 0:644275e48645 | 22 | lcd.cls(); |
hnoons | 0:644275e48645 | 23 | |
hnoons | 0:644275e48645 | 24 | while (1) { |
hnoons | 0:644275e48645 | 25 | |
hnoons | 0:644275e48645 | 26 | if(xbee1.readable()){ |
hnoons | 0:644275e48645 | 27 | char a = xbee1.getc(); |
hnoons | 0:644275e48645 | 28 | lcd.printf("%d", a); |
hnoons | 0:644275e48645 | 29 | } |
hnoons | 0:644275e48645 | 30 | } |
hnoons | 0:644275e48645 | 31 | } |