Add muxpos to internal voltage
This commit is contained in:
parent
ae28be55d3
commit
91ee8b1af8
@ -36,13 +36,18 @@ uint16_t ADC0_read(void) {
|
||||
uint16_t thermistor_voltage_read() {
|
||||
/* Gets value for the diode */
|
||||
ADC0.MUXPOS = 0x03;
|
||||
uint8_t adcVal = ADC0_read();
|
||||
uint8_t adc_val = ADC0_read();
|
||||
|
||||
return adcVal;
|
||||
return adc_val;
|
||||
}
|
||||
|
||||
uint16_t internal_voltage_read() {
|
||||
/* Gets value for the internal voltage reffreance*/
|
||||
|
||||
return VREF.ADC0REF = VREF_REFSEL_VDD_gc;
|
||||
VREF.ADC0REF = VREF_REFSEL_VDD_gc;
|
||||
|
||||
ADC0.MUXPOS = 0x44;
|
||||
uint8_t adc_val = ADC0_read();
|
||||
|
||||
return adc_val*10;
|
||||
}
|
||||
|
||||
@ -55,7 +55,6 @@ extern "C" {
|
||||
// Gets the value from sensor and internal voltage
|
||||
uint16_t internal_voltage_read();
|
||||
uint16_t thermistor_voltage_read();
|
||||
uint16_t internal_voltage_read();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user