RF24Network Send example program.
Dependencies: xtoff RF24Network mbed
Fork of RF24Network_Send by
Diff: Verzender.h
- Revision:
- 11:2aa84e063c49
- Parent:
- 10:875812a04307
- Child:
- 12:38c5efed7950
--- a/Verzender.h Mon Mar 12 11:02:12 2018 +0000 +++ b/Verzender.h Wed Mar 21 16:22:34 2018 +0000 @@ -10,20 +10,31 @@ #define spi_MOSI p5 #define spi_MISO p6 +#define INIT '1' +#define TARE '2' +#define TARE_FIRST '3' +#define TARE_COMPLETE '4' +#define TARE_ERROR '5' +#define POSITION '6' +#define POSITION_WAIT '7' +#define POSITION_ERROR '8' + + #ifdef PRINT_ENABLE #define IF_PRINT_ENABLE(x) ({x;}) #else #define IF_PRINT_ENABLE(x) #endif - //Identificatie verzender/ontvanger const uint16_t this_node = 01; const uint16_t other_node = 00; struct payload_t { bool reedsensor; - float milligram; + float gram; + bool messageAvailable; + char messageIndex; }; enum State {State_init, @@ -35,7 +46,7 @@ }; struct state_Packet { - State setstate; + char setstate; }; @@ -73,6 +84,15 @@ @return message of type state_packet */ state_Packet read(); + + + /*messageIndex: + 0: Nothing wrong + 1: Tare first + 2: Error on Position + 3: Bad Tare value (<2.5V) +*/ + void sendMessage(char index); }; #endif