![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
in d mix
Dependencies: xtoff2 RF24Network mbed
Fork of RF24Network_Receive by
Ontvanger.h@5:14c4e655ccae, 2018-02-14 (annotated)
- Committer:
- pietor
- Date:
- Wed Feb 14 08:54:16 2018 +0000
- Revision:
- 5:14c4e655ccae
- Parent:
- 4:7ebc3b421306
- Child:
- 6:6a82110ff393
Update 14/02
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pietor | 4:7ebc3b421306 | 1 | #ifndef Ontvanger_h |
pietor | 4:7ebc3b421306 | 2 | #define Ontvanger_h |
pietor | 4:7ebc3b421306 | 3 | #include "mbed.h" |
pietor | 4:7ebc3b421306 | 4 | #include <RF24Network.h> |
pietor | 4:7ebc3b421306 | 5 | #include <RF24.h> |
pietor | 4:7ebc3b421306 | 6 | |
pietor | 5:14c4e655ccae | 7 | |
pietor | 4:7ebc3b421306 | 8 | #define nrf_CE p9 |
pietor | 4:7ebc3b421306 | 9 | #define nrf_CSN p8 |
pietor | 4:7ebc3b421306 | 10 | #define spi_SCK p7 |
pietor | 4:7ebc3b421306 | 11 | #define spi_MOSI p5 |
pietor | 4:7ebc3b421306 | 12 | #define spi_MISO p6 |
pietor | 4:7ebc3b421306 | 13 | |
pietor | 4:7ebc3b421306 | 14 | const uint16_t this_node = 00; |
pietor | 4:7ebc3b421306 | 15 | const uint16_t other_node = 01; |
pietor | 4:7ebc3b421306 | 16 | |
pietor | 4:7ebc3b421306 | 17 | |
pietor | 4:7ebc3b421306 | 18 | struct payload_t |
pietor | 4:7ebc3b421306 | 19 | { |
pietor | 4:7ebc3b421306 | 20 | bool reedsensor; |
pietor | 4:7ebc3b421306 | 21 | int milligram; |
pietor | 4:7ebc3b421306 | 22 | }; |
pietor | 4:7ebc3b421306 | 23 | |
pietor | 4:7ebc3b421306 | 24 | |
pietor | 4:7ebc3b421306 | 25 | |
pietor | 4:7ebc3b421306 | 26 | class Ontvanger |
pietor | 4:7ebc3b421306 | 27 | { |
pietor | 4:7ebc3b421306 | 28 | private: |
pietor | 4:7ebc3b421306 | 29 | |
pietor | 4:7ebc3b421306 | 30 | |
pietor | 4:7ebc3b421306 | 31 | public: |
pietor | 4:7ebc3b421306 | 32 | Ontvanger(); |
pietor | 4:7ebc3b421306 | 33 | void update(); |
pietor | 4:7ebc3b421306 | 34 | bool available(); |
pietor | 4:7ebc3b421306 | 35 | |
pietor | 4:7ebc3b421306 | 36 | payload_t read(); |
pietor | 4:7ebc3b421306 | 37 | }; |
pietor | 4:7ebc3b421306 | 38 | |
pietor | 4:7ebc3b421306 | 39 | #endif |
pietor | 4:7ebc3b421306 | 40 | |
pietor | 4:7ebc3b421306 | 41 | |
pietor | 4:7ebc3b421306 | 42 | |
pietor | 4:7ebc3b421306 | 43 | |
pietor | 4:7ebc3b421306 | 44 |