fix rebase module05
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user