Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * c_praks.c
- *
- * Created: 20.04.2018 10:10:02
- * Author : Tudeng
- */
- #include <avr/io.h>
- void wait(uint16_t a){
- for (uint16_t g = 0; g<a; g++){
- for(uint32_t i = 0; i < 1000000/11; i++){
- asm volatile ("nop");
- }
- }
- }
- int main(void){
- DDRA = 1;
- while(1){
- //S
- PORTA = 1;
- wait(1);
- PORTA = 0;
- wait(1);
- PORTA = 1;
- wait(1);
- PORTA = 0;
- wait(1);
- PORTA = 1;
- wait(1);
- PORTA = 0;
- wait(3);
- //O
- PORTA = 1;
- wait(3);
- PORTA = 0;
- wait(1);
- PORTA = 1;
- wait(3);
- PORTA = 0;
- wait(1);
- PORTA = 1;
- wait(3);
- PORTA = 0;
- wait(3);
- //S
- PORTA = 1;
- wait(1);
- PORTA = 0;
- wait(1);
- PORTA = 1;
- wait(1);
- PORTA = 0;
- wait(1);
- PORTA = 1;
- wait(1);
- PORTA = 0;
- wait(7);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement