Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #define F_CPU 1000000UL
  2. #include <avr/io.h>
  3. #include <avr/interrupt.h>
  4.  
  5.  ISR(INT0_vect)
  6. {
  7.  ADCSRA|= 1<<ADSC;
  8. }
  9.  
  10.  ISR(ADC_vect)
  11.  {
  12.      PORTB=ADCH;
  13.  }
  14.  
  15. int main(void)
  16. {
  17.      
  18.      ADCSRA=0x8B;
  19.      ADMUX=0x00;
  20. MCUCR =0x0F;                // Trigger INT0 on rising edge
  21.     GICR = 0x40;            // Enable INT0
  22.      sei();
  23.     while(1)
  24.     {
  25.        
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement