m05e00 not so done finally...
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// 1.1.7 : AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6
|
||||
// 1.1.8 : AREF is the analog reference pin for the A/D Converter
|
||||
|
||||
#define ADC_PRESCALER 8
|
||||
#define ADC_PRESCALER 2
|
||||
|
||||
void int_to_hex_string(uint64_t value, char *out, uint8_t num_digits) { // num_digits : number of digit of the output, ex 2 for 3FF (1023) -> FF
|
||||
for (uint8_t i = 0; i < num_digits; ++i) {
|
||||
@@ -22,7 +22,7 @@ int main() {
|
||||
|
||||
while(1) {
|
||||
uint16_t value = adc_read(0); // Read from ADC0 (A0)
|
||||
int_to_hex_string(value, buffer, 3);
|
||||
int_to_hex_string(value, buffer, 2);
|
||||
uart_printstr_endl(buffer);
|
||||
_delay_ms(20); // Wait 20ms
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user