Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.04 KB | None | 0 0
  1. char tytul[]= {' ',' ',' ',' ',' ','P','R','E','S','J','A',' ',' ',' ',' ',' ',
  2.                ' ',' ',' ',' ',' ',' ','C','Z','A','S','U',' ',' ',' ',' ',' '
  3.               };
  4.  
  5. char menu[]= {'N','O','W','A',' ','N','A','J','.',' ','T','W','R','C','Y'
  6.               ,'G','R','A',' ',' ','W','Y','N','I','K',' ','O','P','I','S'
  7.              };
  8.  
  9. char tworcy[]= {'K','.',' ','M','I','E','R','Z','W','I','N','S','K','I',' ',
  10.                 ' ','K','.',' ','L','E','N','C','Z','E','W','S','K','I',' ',' ',' '
  11.                };
  12. char wypisz[]= {'W','Y','N','I','K','='};
  13. char opis[]= {'B','u','t','t','o','n',' ','1','-','l','e','f','t',' ','2','-','r','i','g','h','t',' ','3','-','d','o',
  14.               'w','n','/','u','p'
  15.              };
  16. int up=0; //czy ludzikiem tam gdzie byczek
  17. int k=0; //
  18. int tr=300; //trudnosc gry
  19. P2DIR |= BIT1 ;                               // STATUS LED
  20. P1DIR |=BIT5+BIT6;
  21. P1OUT|=BIT5+BIT6;
  22. WDTCTL=WDTPW+ WDTHOLD;                        // zatrzymanie WDT
  23. int zycia=3;
  24. int yyy=1; //nie wchodzil po przegraniu do if dlatego trzeba bylo dodac nowa zmienna
  25. int tworcy_pom=0;
  26. int opis_pom=1;
  27. int wynik_pom=0;
  28. InitPortsLcd();                               // inicjalizacja portów
  29. InitLCD();                                    // inicjalizacja LCD
  30. clearDisplay();                               // czyszczenie LCD
  31.  
  32. SEND_CMD(CG_RAM_ADDR);
  33. int m;
  34. for(m=0; m<24; m++)
  35. {
  36.     SEND_CHAR(customChar[m]);
  37. }
  38.  
  39. P4DIR =0x00;
  40. int ccc=0;   //ciagle wyswietlal menu dlatego trzeba byl ododac pomocnicza
  41. int wys;
  42. int szer;
  43. int punkty=0;
  44. int xlabel=0; //obsluga zderzen
  45. int xlabel2=0; //obdluga zdarzen
  46. int up2=0;
  47. xlabel2=6;
  48. up2=0;
  49. unsigned int timer;
  50. while(1)
  51. {
  52.  
  53.     if(((P4IN&BIT7)==0 || ccc==1) && yyy==1)     //tworzenie menu
  54.     {
  55.         clearDisplay();
  56.         ccc=0;
  57.         opis_pom=0;
  58.         yyy=0;
  59.         int i;
  60.         for(i=0; i<16; i++)
  61.         {
  62.             SEND_CHAR(tytul[i]);
  63.         }
  64.         SEND_CMD(DD_RAM_ADDR2);
  65.         for(i=16; i<32; i++)
  66.         {
  67.             SEND_CHAR(tytul[i]);
  68.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement