Example #1
0
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);
}
Example #2
0
// 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);
}
Example #3
0
unsigned int mts310cb_Magnetometer_y_GetCounts()
{
	CheckIfInitDone();
	return adc_GetChannel(6);
}
Example #4
0
unsigned int mts310cb_Accelerometer_y_GetCounts()
{
	CheckIfInitDone();
	return adc_GetChannel(4);
}
Example #5
0
unsigned int mts310cb_Microphone_GetCounts()
{
	CheckIfInitDone();
	return adc_GetChannel(2);
}
Example #6
0
// 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);
}