float adc_GetBatteryVoltage() { // adc channel 30 is connected to the internal 1.23 V reference unsigned int adValue; adValue = adc_GetChannel(30); return (1.23 * 1024.0 / (float)adValue); }
// This is a ratiometric value, so use Vcc as reference unsigned int mda100_TemperatureSensor_GetCounts() { CheckIfInitDone(); mda100_TemperatureSensor_Power(POWER_ON); return adc_GetChannel(1); }
unsigned int mts310cb_Magnetometer_y_GetCounts() { CheckIfInitDone(); return adc_GetChannel(6); }
unsigned int mts310cb_Accelerometer_y_GetCounts() { CheckIfInitDone(); return adc_GetChannel(4); }
unsigned int mts310cb_Microphone_GetCounts() { CheckIfInitDone(); return adc_GetChannel(2); }
// This is a ratiometric value, so use Vcc as reference unsigned int mts310cb_LightSensor_GetCounts() { CheckIfInitDone(); mts310cb_LightSensor_Power(POWER_ON); return adc_GetChannel(1); }