Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: RadioHeadLite
Revision 6:3174bb53265a, committed 2021-06-22
- Comitter:
- rlanders73
- Date:
- Tue Jun 22 16:51:01 2021 +0000
- Parent:
- 5:75659bdf6605
- Commit message:
- Added RSSI of recieved messge
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jun 22 16:38:09 2021 +0000 +++ b/main.cpp Tue Jun 22 16:51:01 2021 +0000 @@ -108,9 +108,11 @@ if(radio.available()){ size = sizeof(rxBuf); if(radio.recv(rxBuf,&size)) -// printf("Got: %s\n", rxBuf); - USB.send(rxBuf, size); - USB.putc('\n'); // put a new line in just in case + rxBuf[size] = 0; // make sure to null terminate the string + printf("Got: %s", rxBuf); + if(rxBuf[size-1]!= '\n') + USB.putc('\n'); // put a new line in just in case + printf("RSSI: %d\n",radio.lastRssi()); } } }