Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.94 KB | None | 0 0
  1. #include <msp430x14x.h>
  2. #include "lcd.h"
  3. #include "portyLcd.h"
  4. #define DD_RAM_ADDR 0x80 // set DD_RAM 2 line
  5.  
  6. unsigned char i;
  7. unsigned char znak;
  8.  
  9. void napis(char napis[])
  10. {
  11.   int a = strlen(napis);
  12.   clearDisplay();
  13.   for( i =0; i < a; i++){
  14.     SEND_CHAR(napis[i]);
  15.   }
  16.   for (i=0;i<32;i++){
  17.    SEND_CMD(DATA_ROL_RIGHT);                  // przesuwanie napisu w lewo    
  18.     Delayx100us(250);                        // opóYnienie
  19.     if(i > 16 - a)
  20.     {
  21.       int j = i - 16;
  22.       gotoSecondLine();
  23.       SEND_CHAR(napis[j]);
  24.     }
  25.   }
  26.  
  27. }
  28.  
  29. void main( void )
  30. {
  31. P2DIR |= BIT1 ;                               // STATUS LED
  32. WDTCTL=WDTPW+ WDTHOLD;                        // zatrzymanie WDT
  33.  
  34. InitPortsLcd();                               // inicjalizacja portów  
  35. InitLCD();                                    // inicjalizacja LCD
  36. clearDisplay();                               // czyszczenie LCD  
  37.  
  38. napis("test");
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement