![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is a sample program which shows how to use my library XBeeGetRssi.
Dependencies: XBeeGetRssi mbed
main.cpp@2:eb9a9348fc24, 2013-08-25 (annotated)
- Committer:
- ATKINZ117
- Date:
- Sun Aug 25 13:50:58 2013 +0000
- Revision:
- 2:eb9a9348fc24
- Parent:
- 1:2bddd5230b7e
- Child:
- 3:bc4f426b4f98
improved the performance of this program
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ATKINZ117 | 0:3fdf715b8445 | 1 | #include "mbed.h" |
ATKINZ117 | 0:3fdf715b8445 | 2 | #include "XBeeGetRssi.h" |
ATKINZ117 | 0:3fdf715b8445 | 3 | |
ATKINZ117 | 0:3fdf715b8445 | 4 | XBeeGetRssi RSSI(p9,p10); //tx,rx |
ATKINZ117 | 0:3fdf715b8445 | 5 | Serial pc(USBTX,USBRX); |
ATKINZ117 | 0:3fdf715b8445 | 6 | //Serial MyXbee(p13,p14); |
ATKINZ117 | 0:3fdf715b8445 | 7 | |
ATKINZ117 | 0:3fdf715b8445 | 8 | int main(){ |
ATKINZ117 | 0:3fdf715b8445 | 9 | while(1){ |
ATKINZ117 | 1:2bddd5230b7e | 10 | wait(1.0); |
ATKINZ117 | 1:2bddd5230b7e | 11 | // pc.printf("RSSI: - %s dBm \r\n",RSSI.get()); |
ATKINZ117 | 1:2bddd5230b7e | 12 | pc.printf("RSSI: - "); |
ATKINZ117 | 1:2bddd5230b7e | 13 | for(int i=0;i<10;i++){ |
ATKINZ117 | 2:eb9a9348fc24 | 14 | pc.printf("%c",RSSI.getRssi(i)); |
ATKINZ117 | 1:2bddd5230b7e | 15 | } |
ATKINZ117 | 1:2bddd5230b7e | 16 | pc.printf("dBm \r\n"); |
ATKINZ117 | 1:2bddd5230b7e | 17 | // pc.printf("\r\n"); |
ATKINZ117 | 1:2bddd5230b7e | 18 | pc.printf("This is the end of main.\r\n"); |
ATKINZ117 | 0:3fdf715b8445 | 19 | } |
ATKINZ117 | 0:3fdf715b8445 | 20 | } |