spacepaste

  1.  
  2. #define F_CPU 1000000UL /* 1 MHz Internal Oscillator */
  3. #include <avr/io.h>
  4. #include <util/delay.h>
  5. void delay_ms(uint16_t ms) {
  6. while ( ms )
  7. {
  8. _delay_ms(1);
  9. ms--;
  10. }
  11. }
  12. int main (void)
  13. {
  14. DDRC = _BV (PD6);
  15. while (1)
  16. {
  17. PORTD &= ~_BV(PD6);
  18. delay_ms(1000);
  19. PORTD |= _BV(PD6);
  20. delay_ms(1000);
  21. }
  22. return 0;
  23. }
  24.