Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define F_CPU 1000000UL
- #include <avr/io.h>
- #include <avr/interrupt.h>
- ISR(INT0_vect)
- {
- ADCSRA|= 1<<ADSC;
- }
- ISR(ADC_vect)
- {
- PORTB=ADCH;
- }
- int main(void)
- {
- ADCSRA=0x8B;
- ADMUX=0x00;
- MCUCR =0x0F; // Trigger INT0 on rising edge
- GICR = 0x40; // Enable INT0
- sei();
- while(1)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement