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.cpp
- Revision:
- 20:014a808b3ea2
- Parent:
- 19:3a6bb28892e1
- Child:
- 21:849e5636076e
- Child:
- 22:23d5bb18d6a0
--- a/sensor.cpp Tue May 17 18:07:16 2016 +0000
+++ b/sensor.cpp Tue May 17 18:35:34 2016 +0000
@@ -10,14 +10,14 @@
//This is the producer
void ExpansionBoard::sampleData() {
- printf("about to alloc\n");
+ printf("\nAbout to alloc\n");
log_data* log_d = (log_data*)mail_box.alloc();
if (log_d == NULL) {
mail_box.get();
printf("Out of memory, last sample deleted\n");
log_data* log_d = (log_data*)mail_box.alloc();
- printf("allocated after out of memory");
+ printf("Allocated after out of memory\n");
}
printf("Not null, reading values\n");
@@ -77,27 +77,11 @@
return str;
}
-ExpansionBoard::ExpansionBoard(vector<log_data> vector, int num): T(15.0f), flag(false) {
+ExpansionBoard::ExpansionBoard(vector<log_data> vector, int num, bool lFlag): T(15.0f) {
v = &vector;
n = #
- /* Retrieve the composing elements of the expansion board */
- uint8_t id;
- printf("Initialising expansion board...\n\r");
-
+ flag = &lFlag;
- /*
- humidity_sensor->ReadID(&id);
- printf("No error"); //Debug para ver se o erro e na linha anterior ou no id mesmo
- printf("HTS221 humidity & temperature = %d\r\n", id); //Testa essa usando %d ao em vez de Hex
- pressure_sensor->ReadID(&id);
- printf("LPS25H pressure & temperature = %d\r\n", id);
- magnetometer->ReadID(&id);
- printf("LIS3MDL magnetometer = %d\r\n", id);
- //printf("LIS3MDL magnetometer = 0x%X\r\n\n", id); Antiga forma
- gyroscope->ReadID(&id);
- printf("LSM6DS0 accelerometer & gyroscope = %d\r\n\n", id);
- //printf("LSM6DS0 accelerometer & gyroscope = 0x%X\r\n\n", *id);
-
- */
-
+ /* Retrieve the composing elements of the expansion board */
+ printf("Initialising expansion board...\n\r");
}
\ No newline at end of file
