Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * blink.c
- *
- * Created: 17.09.2014 11:18:17
- * Author: Samuel Munz
- */
- #define F_CPU 16000000UL // legt CPU-Takt Fest
- #include <avr/io.h> // grundlegende IO- Funktionen
- #include <util/delay.h> // für 'Pause'
- //Function Prototypes
- void sleep_ms(uint16_t ms);
- int main(void)
- {
- DDRB |= (1 << PB5); //Setze PORTB Pin5 als Ausgang
- while(1)
- {
- DDRB ^= (1 << PB5); //toggle PB5
- sleep_ms (250); //wait a little
- }
- }
- void sleep_ms(uint16_t ms) //funktion zum 'warten'
- {
- while(ms){
- ms--;
- _delay_ms(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement