Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
sensor_board.h
- Committer:
- Micha? ?azowik
- Date:
- 2017-01-19
- Revision:
- 56:065bd3a75d97
- Parent:
- 51:090149c4aa28
- Child:
- 66:a89b7430b424
File content as of revision 56:065bd3a75d97:
#include "common.h"
#include "sensor.h"
#include <vector>
class Board {
public:
explicit Board(unsigned long long rx_address, DigitalSensor* digital_sensor,
AnalogSensor* analog_sensor, unsigned long long tx_address=MASTER_ADDRESS);
void run();
static const int MAX_RETRY;
private:
int getRandomWaitMs();
bool sendByRadio(char message[TRANSFER_SIZE]);
void displayRadioSetup();
bool send(int id, Data data_to_send);
void updateSensor(Sensor* sensor, bool* should_send_data);
Serial pc_;
nRF24L01P radio_;
AnalogSensor* analog_sensor_;
DigitalSensor* digital_sensor_;
Ticker analog_ticker_;
Ticker digital_ticker_;
};