Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * firsttry.c
- *
- * Created: 17.9.2015 11:15:25
- * Author: d14valicek
- * Rozsvietit LEDku na PB1
- */
- #define F_CPU 1000000UL
- #include <avr/io.h>
- #include <util/delay.h>
- #include <math.h>
- int main(void)
- {
- DDRD = 0xFF;
- while(1)
- {
- for (int c = 1; c <=256; c=c*2)
- {
- PORTD = ~c;
- _delay_ms(100);
- }
- for (int c = 256; c >=1; c=c/2) //hod zacina 0; pyta sa ci je hod mensia ako 256; hod + 1
- {
- PORTD = ~c;
- _delay_ms(100);
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment