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.
Fork of WSN_Coordinator by
Revision 5:2f12cc3b6acb, committed 2016-06-07
- Comitter:
- SIT2016
- Date:
- Tue Jun 07 06:11:45 2016 +0000
- Parent:
- 4:b3a70cbb7c81
- Commit message:
- added serial plotting
Changed in this revision
Receiver.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Receiver.cpp Mon Jun 06 10:57:33 2016 +0000 +++ b/Receiver.cpp Tue Jun 07 06:11:45 2016 +0000 @@ -16,6 +16,7 @@ char count[1]; char RxDataCnt_PIPE0, RxDataCnt_PIPE1; char temp; + char pot1Val, pot2Val; //specifying address same as transmitter for pipe0 and pipe1 long long RxAddress_PIPE1 = 0xE2E2E2E2E2; @@ -57,12 +58,13 @@ // ...read the data into the receive buffer temp = my_nrf24l01p.read( NRF24L01P_PIPE_P0, count, RxDataCnt_PIPE0 ); + + pot1Val = count[0]; - pc.printf("Received: %d bytes from PIPE0; POT=%d\r\n",temp, count[0]); + //pc.printf("Received: %d bytes from PIPE0; POT=%d\r\n",temp, count[0]); // Toggle LED2 (to help debug nRF24L01+ -> Host communication) GreenLED = !GreenLED; - wait_ms(10); } //check if data is there in pipe1 @@ -70,12 +72,15 @@ // ...read the data into the receive buffer temp = my_nrf24l01p.read( NRF24L01P_PIPE_P1, count, RxDataCnt_PIPE1 ); + + pot2Val = count[0]; - pc.printf("Received: %d bytes from PIPE1; POT=%d\r\n",temp, count[0]); + //pc.printf("Received: %d bytes from PIPE1; POT=%d\r\n",temp, count[0]); // Toggle LED2 (to help debug nRF24L01+ -> Host communication) BlueLED = !BlueLED; - wait_ms(10); } + wait_ms(100); + pc.printf("$%d %d;", pot1Val, pot2Val); } } \ No newline at end of file