Use accelerometer to interrupt.

Dependencies:   mbed SDFileSystem

Fork of shomberg_hw_7 by Russell Shomberg

sensors.cpp

Committer:
rshomberg
Date:
2018-11-18
Revision:
29:d33071ffaa5f
Parent:
28:a59485b1626b

File content as of revision 29:d33071ffaa5f:

// 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
}