Matyas Kinde
/
Xbeeget
xbee getting the rfid, oxford project
main.cpp@0:88ed230ff73c, 2013-05-02 (annotated)
- Committer:
- mottiex
- Date:
- Thu May 02 13:25:35 2013 +0000
- Revision:
- 0:88ed230ff73c
xbee gettin! rfid
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mottiex | 0:88ed230ff73c | 1 | #include "mbed.h" |
mottiex | 0:88ed230ff73c | 2 | #include "TextLCD.h" |
mottiex | 0:88ed230ff73c | 3 | |
mottiex | 0:88ed230ff73c | 4 | TextLCD lcd(p15,p16,p17,p18,p19,p20); |
mottiex | 0:88ed230ff73c | 5 | DigitalOut myled(LED1); |
mottiex | 0:88ed230ff73c | 6 | Serial xbee1(p9, p10); |
mottiex | 0:88ed230ff73c | 7 | |
mottiex | 0:88ed230ff73c | 8 | int main() { |
mottiex | 0:88ed230ff73c | 9 | int data; |
mottiex | 0:88ed230ff73c | 10 | // int prev; |
mottiex | 0:88ed230ff73c | 11 | while(1) |
mottiex | 0:88ed230ff73c | 12 | { |
mottiex | 0:88ed230ff73c | 13 | myled = 1; |
mottiex | 0:88ed230ff73c | 14 | if (xbee1.readable()) |
mottiex | 0:88ed230ff73c | 15 | { |
mottiex | 0:88ed230ff73c | 16 | xbee1.scanf(" %d", &data); |
mottiex | 0:88ed230ff73c | 17 | myled = 0; |
mottiex | 0:88ed230ff73c | 18 | // prev = data; |
mottiex | 0:88ed230ff73c | 19 | wait(0.01); |
mottiex | 0:88ed230ff73c | 20 | lcd.printf(" Pin: %d", data); |
mottiex | 0:88ed230ff73c | 21 | wait(20); |
mottiex | 0:88ed230ff73c | 22 | } |
mottiex | 0:88ed230ff73c | 23 | lcd.cls(); |
mottiex | 0:88ed230ff73c | 24 | } |
mottiex | 0:88ed230ff73c | 25 | } |