-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsensor_data.h
More file actions
41 lines (38 loc) · 940 Bytes
/
sensor_data.h
File metadata and controls
41 lines (38 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
struct SensorData {
/* HS300x */
float temperature;
float humidity;
/* APDS9960 */
int proximity;
unsigned long lastUpdate;
char gesture[10];
/* apds9960 color data */
int r;
int g;
int b;
int a;
/* LPS22HB */
float pressure;
float altitude;
/* BMI270 */
float accelX;
float accelY;
float accelZ;
float gyroX;
float gyroY;
float gyroZ;
/* BMM150 */
float magX;
float magY;
float magZ;
/* PDM Microphone */
int micLevel; // average sound level
int micPeak; // peak sound level
/* Orientation (derived from accelerometer) */
int orientation; // 0-6: unknown, face-up, face-down, portrait, portrait-ud, landscape-l, landscape-r
};
extern SensorData sensorData; // defined in sensor_data.cpp
// thread-safe data access helpers
void copySensorDataAtomic(SensorData* dest);
int getCurrentModeAtomic();