Advertisement
SIKER_98

swb-2-wojtas

May 4th, 2020
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <REGX52.H>
  2.  
  3. void main(){
  4. unsigned char wiersz[] = {0xF7, 0xFB, 0xFD, 0xFE};
  5. unsigned char index = 0;
  6. unsigned char liczba = 0x05;
  7. P2 = 0;
  8.  
  9. while (1){
  10. P1 = wiersz[index++];
  11.  
  12. if (!P1_4){
  13. if (index != 4){
  14. liczba *= 0x10;
  15. liczba += (index - 1) * 3 + 1;
  16. }
  17. while (!P1_4);
  18. }
  19. else if (!P1_5){
  20. liczba *= 0x10;
  21. if (index != 4)liczba += (index - 1) * 3 + 2;
  22. while (!P1_5);
  23. }
  24. else if (!P1_6)
  25. {
  26. if (index == 4){
  27. P2 = liczba;
  28. liczba = 0;
  29. }else{
  30. liczba *= 0x10;
  31. liczba += (index - 1) * 3 + 3;
  32. }
  33. while (!P1_6);
  34. }
  35. if (index == 4)index = 0;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement