Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<avr/io.

h>
#include <util/delay.h>
#define LED_PIN (1<<PB1) // DO TEGO PINU PODCZONA JEST DIODA.
#define LED_ON PORTB &= ~LED_PIN //DIODA JEST ZACZONA.
#define LED_OFF PORTB |= LED_PIN //DIODA JEST WYCZONA.
#define LED_TOG PORTB ^= LED_PIN // DIODA ZMIANIA SWOJA WARTO C.
int main(void){
DDRB |= LED_PIN; // KIERUNEK PINU (WYJ CIE).
while(1){
LED_ON;
//DIODA JEST WCZONA.
_delay_ms(1000); // CZAS 1S
LED_OFF;
// DIODA JEST WYCZONA.
_delay_ms(1000);
}
}

You might also like