Use accelerometer to interrupt.
Dependencies: mbed SDFileSystem
Fork of shomberg_hw_7 by
Diff: sensors.h
- Revision:
- 28:a59485b1626b
- Child:
- 29:d33071ffaa5f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sensors.h Fri Nov 16 19:53:25 2018 +0000 @@ -0,0 +1,31 @@ +#ifndef SENSORS_H +#define SENSORS_H + +#include "mbed.h" +#include "MMA8452Q.h" + +// Modifiable Variables +#define VREF 3.3 +#define TEMP_CALIBRATION_A 0.1 +#define TEMP_CALIBRATION_B -50 + +// Pin Configuration +#define PIN_SWITCH p9 +#define PIN_TEMP_SENSOR p20 + +// Pin Configuration Accel +#define PIN_ACCEL_SDA p27 +#define PIN_ACCEL_SCL p28 +#define PIN_ACCEL_INTERRUPT p26 + +#define TRAANSIENT_RECORD_TIME 3 //seconds + +int readSwitch(void); + +float readTempSensor(void); + +float mvToTemp(float sensorVoltage); + +void recordTransient(void); + +#endif \ No newline at end of file