Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. /* MAIN.C file
  2. *
  3. * Copyright (c) 2002-2005 STMicroelectronics
  4. */
  5. #include "st72334n2.h"
  6.  
  7.  
  8.  
  9. void delay(int x)
  10. {
  11. int i = 0;
  12. while(i < x)
  13. {
  14. i++;
  15. }
  16. }
  17.  
  18. main()
  19. {
  20. MCCSR |= 0b00001010;
  21. MCCSR &= ~0b00000100;
  22.  
  23. PDDDR |= 0b11111110;
  24. PDOR |= 0b11111110;
  25.  
  26. PADDR |= 0b00001101;
  27. PAOR |= 0b00001101;
  28.  
  29. #asm
  30. RIM
  31. #endasm
  32.  
  33. while(1)
  34. {
  35. PADR |= 0b00001000;
  36.  
  37. PDDR |= 0b01111110; //ustawiamy 0
  38. PDDR &= 0b01111110;
  39.  
  40.  
  41. PDDR |= 0b00110000; //ustawiamy 1
  42. PDDR &= 0b00110000;
  43.  
  44. PDDR |= 0b11011010; //ustawiamy 2
  45. PDDR &= 0b11011010;
  46.  
  47. PDDR |= 0b11111000; //ustawiamy 3
  48. PDDR &= 0b11111000;
  49.  
  50. PDDR |= 0b10110100; //ustawiamy 4
  51. PDDR &= 0b10110100;
  52.  
  53. PDDR |= 0b11101100; //ustawiamy 5
  54. PDDR &= 0b11101100;
  55.  
  56. PDDR |= 0b11101110; //ustawiamy 6
  57. PDDR &= 0b11101110;
  58.  
  59. PDDR |= 0b00111000; //ustawiamy 7
  60. PDDR &= 0b00111000;
  61.  
  62. PDDR |= 0b11111110; //ustawiamy 8
  63. PDDR &= 0b11111110;
  64.  
  65. PDDR |= 0b11111100; //ustawiamy 9
  66. PDDR &= 0b11111100;
  67.  
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement