![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dd
Dependencies: xtoff2 RF24Network mbed
Fork of xtoff3 by
Ontvanger.h@4:7ebc3b421306, 2018-02-12 (annotated)
- Committer:
- pietor
- Date:
- Mon Feb 12 16:50:45 2018 +0000
- Revision:
- 4:7ebc3b421306
- Child:
- 5:14c4e655ccae
Ontvanger;
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 | 4:7ebc3b421306 | 7 | #define nrf_CE p9 |
pietor | 4:7ebc3b421306 | 8 | #define nrf_CSN p8 |
pietor | 4:7ebc3b421306 | 9 | #define spi_SCK p7 |
pietor | 4:7ebc3b421306 | 10 | #define spi_MOSI p5 |
pietor | 4:7ebc3b421306 | 11 | #define spi_MISO p6 |
pietor | 4:7ebc3b421306 | 12 | |
pietor | 4:7ebc3b421306 | 13 | const uint16_t this_node = 00; |
pietor | 4:7ebc3b421306 | 14 | const uint16_t other_node = 01; |
pietor | 4:7ebc3b421306 | 15 | |
pietor | 4:7ebc3b421306 | 16 | |
pietor | 4:7ebc3b421306 | 17 | struct payload_t |
pietor | 4:7ebc3b421306 | 18 | { |
pietor | 4:7ebc3b421306 | 19 | bool reedsensor; |
pietor | 4:7ebc3b421306 | 20 | int milligram; |
pietor | 4:7ebc3b421306 | 21 | }; |
pietor | 4:7ebc3b421306 | 22 | |
pietor | 4:7ebc3b421306 | 23 | |
pietor | 4:7ebc3b421306 | 24 | |
pietor | 4:7ebc3b421306 | 25 | class Ontvanger |
pietor | 4:7ebc3b421306 | 26 | { |
pietor | 4:7ebc3b421306 | 27 | private: |
pietor | 4:7ebc3b421306 | 28 | |
pietor | 4:7ebc3b421306 | 29 | |
pietor | 4:7ebc3b421306 | 30 | public: |
pietor | 4:7ebc3b421306 | 31 | Ontvanger(); |
pietor | 4:7ebc3b421306 | 32 | void update(); |
pietor | 4:7ebc3b421306 | 33 | bool available(); |
pietor | 4:7ebc3b421306 | 34 | |
pietor | 4:7ebc3b421306 | 35 | payload_t read(); |
pietor | 4:7ebc3b421306 | 36 | }; |
pietor | 4:7ebc3b421306 | 37 | |
pietor | 4:7ebc3b421306 | 38 | #endif |
pietor | 4:7ebc3b421306 | 39 | |
pietor | 4:7ebc3b421306 | 40 | |
pietor | 4:7ebc3b421306 | 41 | |
pietor | 4:7ebc3b421306 | 42 | |
pietor | 4:7ebc3b421306 | 43 |