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
sensor.h@7:ed4a10ebe720, 2016-05-15 (annotated)
- Committer:
- Jacinta
- Date:
- Sun May 15 22:07:10 2016 +0000
- Revision:
- 7:ed4a10ebe720
- Parent:
- 3:1f17245afc88
- Child:
- 10:2f9585ff5a7b
.......
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jacinta | 0:1eaebb55408a | 1 | #ifndef EXPANSIONBOARD_H |
Jacinta | 0:1eaebb55408a | 2 | #define EXPANSIONBOARD_H |
Jacinta | 7:ed4a10ebe720 | 3 | |
Jacinta | 0:1eaebb55408a | 4 | #include "rtos.h" |
Jacinta | 0:1eaebb55408a | 5 | #include "log.h" |
Jacinta | 0:1eaebb55408a | 6 | #include "x_nucleo_iks01a1.h" |
Jacinta | 2:0b8065489409 | 7 | #include <vector> |
Jacinta | 2:0b8065489409 | 8 | |
Jacinta | 2:0b8065489409 | 9 | using std::vector; |
Jacinta | 0:1eaebb55408a | 10 | |
Jacinta | 0:1eaebb55408a | 11 | #define QUEUESIZE 120 |
Jacinta | 0:1eaebb55408a | 12 | |
Jacinta | 2:0b8065489409 | 13 | /* Instantiate the expansion board */ |
Jacinta | 0:1eaebb55408a | 14 | static X_NUCLEO_IKS01A1 *mems_expansion_board = X_NUCLEO_IKS01A1::Instance(D14, D15); |
Jacinta | 0:1eaebb55408a | 15 | |
Jacinta | 0:1eaebb55408a | 16 | static GyroSensor *gyroscope = mems_expansion_board->GetGyroscope(); |
Jacinta | 0:1eaebb55408a | 17 | static MotionSensor *accelerometer = mems_expansion_board->GetAccelerometer(); |
Jacinta | 0:1eaebb55408a | 18 | static MagneticSensor *magnetometer = mems_expansion_board->magnetometer; |
Jacinta | 0:1eaebb55408a | 19 | static HumiditySensor *humidity_sensor = mems_expansion_board->ht_sensor; |
Jacinta | 0:1eaebb55408a | 20 | static PressureSensor *pressure_sensor = mems_expansion_board->pt_sensor; |
Jacinta | 2:0b8065489409 | 21 | static TempSensor *temp_sensor = mems_expansion_board->ht_sensor; |
Jacinta | 0:1eaebb55408a | 22 | |
Jacinta | 0:1eaebb55408a | 23 | class ExpansionBoard |
Jacinta | 0:1eaebb55408a | 24 | { |
Jacinta | 0:1eaebb55408a | 25 | public: |
Jacinta | 7:ed4a10ebe720 | 26 | ExpansionBoard(vector<log_data> vector, int num); |
Jacinta | 2:0b8065489409 | 27 | static void sampleData(); |
Jacinta | 3:1f17245afc88 | 28 | static void getData(const void*); |
Jacinta | 2:0b8065489409 | 29 | static Mail<log_data, QUEUESIZE> mail_box; |
Jacinta | 2:0b8065489409 | 30 | static char *ExpansionBoard::printDouble(char* str, double v, int decimalDigits); |
Jacinta | 7:ed4a10ebe720 | 31 | float T; //Default sampling rate, specified in specs |
Jacinta | 7:ed4a10ebe720 | 32 | static vector<log_data> * v; |
Jacinta | 7:ed4a10ebe720 | 33 | static int * n; |
Jacinta | 0:1eaebb55408a | 34 | }; |
Jacinta | 0:1eaebb55408a | 35 | |
Jacinta | 0:1eaebb55408a | 36 | #endif |