Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<msp430x14x.h>
- #include "lcd.h"
- #include "portyLcd.h"
- unsigned char i;
- unsigned char znak;
- void initS() {
- SEND_CMD(0x40);
- int string[] = {0x2,0x4,0xe,0x10,0xe,0x1,0x1e,0x0};
- for (int i = 0; i < 8; i++)
- SEND_CHAR(string[i]);
- SEND_CMD(0x80);
- }
- void initE() {
- SEND_CMD(0x40);
- int string[] = {0x0,0x0,0xe,0x11,0x1f,0x10,0xe,0x2};
- for (int i = 0; i < 8; i++)
- SEND_CHAR(string[i]);
- SEND_CMD(0x80);
- }
- void printText() {
- char text[] = "Wszystkich witych";
- for (int i = 0; i < 17; i++) {
- if (i == 11) SEND_CHAR(0x00);
- if (i == 13) SEND_CHAR(0x01);
- SEND_CHAR(text[i]);
- }
- }
- void main( void )
- { // STATUS LED
- WDTCTL=WDTPW + WDTHOLD; // zatrzymanie WDT
- InitPortsLcd(); // inicjalizacja portów
- InitLCD(); // inicjalizacja LCD
- clearDisplay(); // czyszczenie LCD
- initE();
- initS();
- //SEND_CHAR(0x00);
- //SEND_CHAR(0x01);
- printText();
- while (1) // nieskończona pętla
- { // zmiana stanu diody na przeciwny
- //SEND_CMD(DATA_ROL_LEFT); // przesuwanie napisu w lewo
- for (int i = 0; i < 3; i++) {
- SEND_CMD(DATA_ROL_LEFT);
- Delayx100us(250);
- Delayx100us(250);
- Delayx100us(250);
- }
- for (int i = 0; i < 3; i++) {
- SEND_CMD(DATA_ROL_RIGHT);
- Delayx100us(250);
- Delayx100us(250);
- Delayx100us(250);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment