![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
dd
Dependencies: xtoff2 RF24Network mbed
Fork of xtoff3 by
Ontvanger.cpp
- Committer:
- pietor
- Date:
- 2018-02-12
- Revision:
- 4:7ebc3b421306
- Child:
- 6:6a82110ff393
File content as of revision 4:7ebc3b421306:
#include "Ontvanger.h" RF24 radio(spi_MOSI, spi_MISO, spi_SCK, nrf_CE, nrf_CSN ); RF24Network network(radio); RF24NetworkHeader header_rx; Ontvanger::Ontvanger() { wait_ms(1000); radio.begin(); network.begin(90, this_node); wait_ms(2000); }; void Ontvanger::update() { network.update(); } bool Ontvanger::available() { return network.available(); } payload_t Ontvanger::read() { payload_t payload_rx; network.read(header_rx,&payload_rx,sizeof(payload_rx)); return payload_rx; }