-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
31 lines (23 loc) · 1.04 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "msp.h"
#include <stdint.h>
#include "lcd16x2_msp43x.h"
int main(void)
{
WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD; // stop watchdog timer
P4->DIR = 0xFF; // Set P4 pins as output
P4->OUT = 0x00; // Clear all pins
lcd16x2_Init(); // Initialize LCD
lcd16x2_SetPosition( 0, 0 ); // Set position of the cursor (row, column)
lcd16x2_PrintString("MSP432P401R"); // Print text
lcd16x2_SetPosition( 1, 0 );
lcd16x2_PrintString("16x2 LCD");
//lcd16x2_Cmd( LCD_CMD_CLEAR_LCD );
//lcd16x2_Cmd( LCD_CMD_DISPLAY_OFF_CURSOR_OFF );
lcd16x2_Cmd( LCD_CMD_DISPLAY_ON_CURSOR_OFF );
//lcd16x2_Cmd( LCD_CMD_DISPLAY_ON_CURSOR_BLINK );
/* The underscore at the end of printed text isn't any kind of error,
it's just a cursor and it's possible to manipulate its state
in lcd16x2_msp43x.c or directly from main.c */
//lcd16x2_Cmd(LCD_CMD_DISPLAY_ON_CURSOR_OFF); // display ON, cursor OFF/ON/BLINK
// lines 101-103 in lcd16x2_msp43x.h
}