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.
Dependencies: X_NUCLEO_IKS01A1-f255a2c75ecb mbed-rtos mbed
Diff: sensor.h
- Revision:
- 2:0b8065489409
- Parent:
- 0:1eaebb55408a
- Child:
- 3:1f17245afc88
--- a/sensor.h Sat May 14 09:30:21 2016 +0000 +++ b/sensor.h Sat May 14 13:58:57 2016 +0000 @@ -3,9 +3,13 @@ #include "rtos.h" #include "log.h" #include "x_nucleo_iks01a1.h" +#include <vector> + +using std::vector; #define QUEUESIZE 120 +/* Instantiate the expansion board */ static X_NUCLEO_IKS01A1 *mems_expansion_board = X_NUCLEO_IKS01A1::Instance(D14, D15); static GyroSensor *gyroscope = mems_expansion_board->GetGyroscope(); @@ -13,25 +17,17 @@ static MagneticSensor *magnetometer = mems_expansion_board->magnetometer; static HumiditySensor *humidity_sensor = mems_expansion_board->ht_sensor; static PressureSensor *pressure_sensor = mems_expansion_board->pt_sensor; -static TempSensor *temp_sensor1 = mems_expansion_board->ht_sensor; -static TempSensor *temp_sensor2 = mems_expansion_board->pt_sensor; +static TempSensor *temp_sensor = mems_expansion_board->ht_sensor; class ExpansionBoard { - uint8_t id; - public: ExpansionBoard(); - Mail<Log, QUEUESIZE> mail_box; - int front; - int back; - float T; - void readData(); - void stopSampling(); - void startSampling(); - bool isEmpty(); - int size(); - bool isFull(); + static void sampleData(); + static void getData(vector<log_data>& v); + static Mail<log_data, QUEUESIZE> mail_box; + static char *ExpansionBoard::printDouble(char* str, double v, int decimalDigits); + float T; //Default sampling rate, specified in specs }; #endif \ No newline at end of file