Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 3
0
unsigned int mts310cb_Magnetometer_y_GetCounts()
{
	CheckIfInitDone();
	return adc_GetChannel(6);
}
Exemplo n.º 4
0
unsigned int mts310cb_Accelerometer_y_GetCounts()
{
	CheckIfInitDone();
	return adc_GetChannel(4);
}
Exemplo n.º 5
0
unsigned int mts310cb_Microphone_GetCounts()
{
	CheckIfInitDone();
	return adc_GetChannel(2);
}
Exemplo n.º 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);
}