Use accelerometer to interrupt.
Dependencies: mbed SDFileSystem
Fork of shomberg_hw_7 by
sensors.cpp
- Committer:
- rshomberg
- Date:
- 2018-11-16
- Revision:
- 28:a59485b1626b
File content as of revision 28:a59485b1626b:
// INCLUDES #include "mbed.h" #include "sensors.h" DigitalIn myswitch(PIN_SWITCH); AnalogIn aIn(PIN_TEMP_SENSOR); //int switchPosition; //int sensorVoltage; //int sensorTemp; int readSwitch(void) { return myswitch; } float readTempSensor(void){ return aIn*VREF*1000; // voltage in mV } float mvToTemp(float sensorVoltage) { return sensorVoltage*TEMP_CALIBRATION_A+TEMP_CALIBRATION_B; //temp in deg C }