simple zbee receive data
Dependencies: C12832_lcd mbed zbee_lib
main.cpp@2:f0efd0fd3544, 2017-04-05 (annotated)
- Committer:
- ruslylove
- Date:
- Wed Apr 05 10:57:43 2017 +0000
- Revision:
- 2:f0efd0fd3544
- Parent:
- 0:c19cf740caf3
simple rx
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ruslylove | 0:c19cf740caf3 | 1 | #include "mbed.h" |
ruslylove | 0:c19cf740caf3 | 2 | #include "zbee.h" |
ruslylove | 0:c19cf740caf3 | 3 | #include "C12832_lcd.h" |
ruslylove | 0:c19cf740caf3 | 4 | |
ruslylove | 0:c19cf740caf3 | 5 | DigitalOut myled(LED1); |
ruslylove | 0:c19cf740caf3 | 6 | zbee zbee1(p9,p10,ZBEE_BAUD); |
ruslylove | 0:c19cf740caf3 | 7 | C12832_LCD lcd; |
ruslylove | 0:c19cf740caf3 | 8 | |
ruslylove | 0:c19cf740caf3 | 9 | char text[50]; // buffer read |
ruslylove | 0:c19cf740caf3 | 10 | |
ruslylove | 0:c19cf740caf3 | 11 | int main() { |
ruslylove | 0:c19cf740caf3 | 12 | int i=1; |
ruslylove | 0:c19cf740caf3 | 13 | while(1) { |
ruslylove | 0:c19cf740caf3 | 14 | zbee1.ReceiveData(text,11); |
ruslylove | 0:c19cf740caf3 | 15 | lcd.printf("%i RX <- %s\n",i++,text); |
ruslylove | 0:c19cf740caf3 | 16 | } |
ruslylove | 0:c19cf740caf3 | 17 | } |
ruslylove | 2:f0efd0fd3544 | 18 | // simple rx |