fix rebase module05

This commit is contained in:
hugogogo
2025-03-15 16:31:30 +01:00
parent 8fef07135a
commit 1d5e8d4ee7
9 changed files with 46 additions and 22 deletions

View File

@@ -16,20 +16,14 @@
volatile uint8_t adc_channel = 0;
// description
// read potentiometer value and print it in uart as hexadecimal 2-number
int main() {
char buffer[4];
SREG |= ENABLE_GLOBAL_INTERRUPT; // 7.3.1 : Status Register, bit 7 : I Global Interrupt Enable
uart_init();
adc_init(ADC_PRESCALER);
while(1) {
uint16_t value = adc_read(0); // Read from ADC0 (A0)
int_to_hex_string(value, buffer, 2);
uart_printstr_endl(buffer);
_delay_ms(20); // Wait 20ms
}
}
timer_1B_init();
// ISR(ADC_vect) { // Table 12-6 : interrupt vector for ADC Conversion Complete
// }
while(1);
}