Skip to content
Snippets Groups Projects
Select Git revision
  • 0ba264323975d1dc4dd71499afc9d06ee4ce3d5e
  • master default
2 results

blink-8.c

Blame
  • Forked from Peter Gerwinski / hp
    328 commits behind the upstream repository.
    blink-8.c 374 B
    #include <avr/io.h>
    #include <avr/interrupt.h>
    #include <stdint.h>
    
    ISR (INT0_vect)  /* PD2 */
    {
      PORTD ^= 0x40;
    }
    
    int main (void)
    {
      cli ();
      EICRA = 1 << ISC00 | 1 << ISC01;  /* INT0: steigende Flanke */
      EIMSK = 1 << INT0;  /* INT0 einschalten */
      sei ();
      DDRD = 0xff;   /* binär: 1111 1111 */
      PORTD = 0x40;  /* binär: 0100 0000 */
      while (1);
      return 0;
    }