Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. /*
  2. * c_praks.c
  3. *
  4. * Created: 20.04.2018 10:10:02
  5. * Author : Tudeng
  6. */
  7.  
  8. #include <avr/io.h>
  9.  
  10. void wait(uint16_t a){
  11. for (uint16_t g = 0; g<a; g++){
  12. for(uint32_t i = 0; i < 1000000/11; i++){
  13. asm volatile ("nop");
  14. }
  15. }
  16. }
  17.  
  18. int main(void){
  19. DDRA = 1;
  20.  
  21. while(1){
  22. //S
  23. PORTA = 1;
  24. wait(1);
  25. PORTA = 0;
  26. wait(1);
  27. PORTA = 1;
  28. wait(1);
  29. PORTA = 0;
  30. wait(1);
  31. PORTA = 1;
  32. wait(1);
  33. PORTA = 0;
  34. wait(3);
  35.  
  36. //O
  37. PORTA = 1;
  38. wait(3);
  39. PORTA = 0;
  40. wait(1);
  41. PORTA = 1;
  42. wait(3);
  43. PORTA = 0;
  44. wait(1);
  45. PORTA = 1;
  46. wait(3);
  47. PORTA = 0;
  48. wait(3);
  49.  
  50. //S
  51. PORTA = 1;
  52. wait(1);
  53. PORTA = 0;
  54. wait(1);
  55. PORTA = 1;
  56. wait(1);
  57. PORTA = 0;
  58. wait(1);
  59. PORTA = 1;
  60. wait(1);
  61. PORTA = 0;
  62. wait(7);
  63. }
  64. return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement