Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. if((P4IN&BIT7)==0 && opis_pom==0) //opis
  2. {
  3. opis_pom=1;
  4. clearDisplay();
  5. SEND_CMD(DD_RAM_ADDR);
  6. for(i=0; i<16; i++)
  7. {
  8. SEND_CHAR(opis[i]);
  9. }
  10. SEND_CMD(DD_RAM_ADDR2);
  11. for(i=16; i<31; i++)
  12. {
  13. SEND_CHAR(opis[i]);
  14. }
  15. mydelay(400);
  16. while((P4IN&BIT7)==0);
  17. }
  18. if((P4IN&BIT4)==0) //gra
  19. {
  20. clearDisplay();
  21. SEND_CMD(DD_RAM_ADDR);
  22. SEND_CHAR(1);
  23. mydelay(200);
  24. while(1)
  25. {
  26. if(xlabel!=0)
  27. {
  28. if((P4IN&BIT4)==0)
  29. {
  30. SEND_CMD(DATA_ROL_LEFT);
  31. xlabel--;
  32. while((P4IN&BIT4)==0);
  33. }
  34. }
  35. if(xlabel!=15)
  36. {
  37. if((P4IN&BIT5)==0)
  38. {
  39. SEND_CMD(DATA_ROL_RIGHT);
  40. xlabel++;
  41. while((P4IN&BIT5)==0);
  42. }
  43. }
  44. if((P4IN&BIT6)==0)
  45. {
  46. if(up==0)
  47. {
  48. clearDisplay();
  49. SEND_CMD(DD_RAM_ADDR2);
  50. SEND_CHAR(1);
  51. for(i=0; i<xlabel; i++)
  52. {
  53. SEND_CMD(DATA_ROL_RIGHT);
  54. }
  55. up=1;
  56. while((P4IN&BIT6)==0);
  57. mydelay(100);
  58. continue;
  59. }
  60. if(up==1)
  61. {
  62. clearDisplay();
  63. SEND_CMD(DD_RAM_ADDR);
  64. SEND_CHAR(1);
  65. for(i=0; i<xlabel; i++)
  66. {
  67. SEND_CMD(DATA_ROL_RIGHT);
  68. }
  69. up=0;
  70. while((P4IN&BIT6)==0);
  71. mydelay(100);
  72. continue;
  73. }
  74. }
  75. timer++;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement