in d mix
Dependencies: xtoff2 RF24Network mbed
Fork of RF24Network_Receive by
Diff: main.cpp
- Revision:
- 13:f54dfb74247e
- Parent:
- 12:a3dd2ebf8f93
- Child:
- 14:3e69c8a9c730
--- a/main.cpp Mon Mar 12 10:56:50 2018 +0000 +++ b/main.cpp Wed Mar 21 16:22:28 2018 +0000 @@ -22,7 +22,7 @@ ---- ----- */ //uncommend #define PRINT_ENABLE to see informational prints -#define PRINT_ENABLE +//#define PRINT_ENABLE #include "mbed.h" #include "Ontvanger.h" @@ -78,10 +78,11 @@ IF_PRINT_ENABLE(pc.printf("Send State\n\r");); if(c == 's') { IF_PRINT_ENABLE(pc.printf("Send state: Tare\n\r");); - packet.setState = State_tare; - } else if (c == 'c') { + packet.setState = 's'; + } + if (c == 'c') { IF_PRINT_ENABLE(pc.printf("Send state: Calibrate\n\r");); - packet.setState = State_calibrate; + packet.setState = 'c'; } bool ok = receive.write(packet); if (ok) @@ -97,9 +98,11 @@ if (receive.available()) { payload_t payload; payload = receive.read(); - pc.printf("%f\r\n", payload.milligram); - if (payload.reedsensor) { - acitvateLed(); + if(!payload.messageAvailable) { + pc.printf("%f\r\n", payload.gram); + if (payload.reedsensor) { + acitvateLed(); + } } }