/* | |
* _10bits.c | |
* | |
* Created: 24/06/2019 01:01:25 p.m. | |
* Author: JG-Hetpro | |
*/ | |
#include <avr/io.h> | |
#include<util/delay.h> | |
int main(void) | |
{ | |
DDRD=0xFF; // declaramos el puerto D como salida | |
DDRB=0xFF; // declaramos el puerto B como salida | |
ADMUX=0b11000000; // voltaje de ref 2.56v, resultado a la derecha, usamos el ADC0. | |
while(1) | |
{ | |
ADCSRA=0b11100100; // habilitamos, iniciamos, free running, factor de divisisión = 16 | |
PORTB=ADCL; // Almacenamos el valor de ADCL en el puerto B y lo mostramos | |
PORTD=ADCH; // Almacenamos el valor de ADCH en el puerto D y lo mostramos | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment