Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<18f8720.h> //dodanie biblioteki
- #pragma use standard_io(d) //zmienia kierunkowość portów automatycznie
- #pragma fuses HS,NOWDT,NOLVP,MCU //bity konfiguracyjne
- #pragma case
- #pragma use delay (clock=10000000) //fumkcja opozienia
- main()
- {
- int x=1;
- int y = 1;
- while(true)
- {
- output_d(x);
- delay_ms(200);
- if(x >= 128)
- {
- y = y * (-1);
- }
- if(y == 1)
- {
- x = x * 2;
- }
- else
- {
- x = x / 2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement