Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Blink Arduino DIGITAL PIN 13 (LED).c
- *
- * Created: 04.12.17 11:24:32
- * Author : Hiestermann
- */
- #ifndef F_CPU // Hier wird abgefragt ob F_CPU schon definiert ist
- #define F_CPU 18432000 // wenn F_CPU noch nicht definiert war, wird es hier mit 18,432MHz nachgeholt
- #warning "F_CPU war nicht definiert, wurde jetzt nachgeholt" // und zusätzlich eine Warnung ausgegeben
- #endif
- #include <avr/io.h>
- #include <util/delay.h>
- int main(void)
- {
- DDRB=0xFF; //Setzte Port B auf Ausgang
- PORTB=0b0000000; //Setze PORTB auf low
- while (1)
- {
- PORTB |= (1 << PORTB5); // Arduino DIGITAL PIN 13 (LED) auf HIGH
- _delay_ms(500); // 500ms Warten
- PORTB &= (0 << PORTB5); // Arduino DIGITAL PIN 13 (LED) auf LOW
- _delay_ms(500); // 500ms Warten
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement