diff --git a/prosjekt.X/voltage.c b/prosjekt.X/voltage.c index 3a26823..95b79a3 100644 --- a/prosjekt.X/voltage.c +++ b/prosjekt.X/voltage.c @@ -23,19 +23,20 @@ uint16_t ADC0_read(void) { ; } // Clear the interrupt flag by writing 1: - ADC0.INTFLAGS = ADC_RESRDY_bm; + ADC0.INTFLAGS = ADC_RESRDY_bm; return ADC0.RES; } -uint16_t diode_voltage_read(void){ +uint16_t diode_voltage_read() { /* Gets value for the diode */ uint8_t adcVal = ADC0_read(); return adcVal; } -uint16_t internal_voltage_read(void) { + +uint16_t internal_voltage_read() { /* Gets value for the internal voltage reffreance*/ - + VREF.ADC0REF = VREF_REFSEL_VDD_gc; - + } \ No newline at end of file diff --git a/prosjekt.X/voltage.h b/prosjekt.X/voltage.h index 381f8fd..c006796 100644 --- a/prosjekt.X/voltage.h +++ b/prosjekt.X/voltage.h @@ -45,16 +45,16 @@ extern "C" { #endif /* __cplusplus */ -// Initializing of the ADC0 pins + // Initializing of the ADC0 pins -void ADC0_init(void); -// -//void ADC0_start(void); -//Start ADC conversion -uint16_t ADC0_read(void); -// Gets the value from sensor and internal voltage -uint16_t internal_voltage_read(void); -uint16_t diode_voltage_read(void) + void ADC0_init(void); + // + //void ADC0_start(void); + //Start ADC conversion + uint16_t ADC0_read(void); + // Gets the value from sensor and internal voltage + uint16_t internal_voltage_read(); + uint16_t diode_voltage_read(); #ifdef __cplusplus } #endif /* __cplusplus */