Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.12 KB | None | 0 0
  1. #include<msp430x14x.h>
  2. #include<stdlib.h>
  3. #include<time.h>
  4. #include "lcd.h"
  5. #include "portyLcd.h"
  6.  
  7. void konwersja(int liczba)
  8. {
  9.     char tab[32];
  10.     int v=0,i=0;
  11.     if(liczba==0)
  12.     {
  13.         SEND_CHAR('0');
  14.         return ;
  15.     }
  16.     while(liczba!=0)
  17.     {
  18.         tab[v]=liczba%10+48;
  19.         liczba=liczba/10;
  20.         v++;
  21.  
  22.     }
  23.     for(i=v-1; i>=0; i--)
  24.     {
  25.  
  26.         SEND_CHAR(tab[i]);
  27.     }
  28. }
  29.  
  30. void mydelay(int a)
  31. {
  32.     int s=0;
  33.     int d=0;
  34.     for(s=0; s<a; s++)
  35.     {
  36.         for(d=0; d<a; d++)
  37.         {
  38.             _NOP();
  39.         }
  40.     }
  41. }
  42.  
  43. void main( void )
  44. {
  45.     int i;
  46.     int highscore=0;
  47.     srand(time(NULL));
  48.     P4DIR&=~BIT4;
  49.     P4DIR&=~BIT5;
  50.     P4DIR&=~BIT6;
  51.     P4DIR&=~BIT7;
  52.  
  53.     char  customChar[] = {
  54.         0x02,
  55.         0x04,
  56.         0x0E,
  57.         0x11,
  58.         0x11,
  59.         0x11,
  60.         0x0E,
  61.         0x00,
  62.         0x0E,
  63.         0x0E,
  64.         0x05,
  65.         0x1F,
  66.         0x14,
  67.         0x04,
  68.         0x0A,
  69.         0x11,
  70.         0x11,
  71.         0x0E,
  72.         0x0E,
  73.         0x1F,
  74.         0x11,
  75.         0x1F,
  76.         0x11,
  77.         0x11
  78.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement