Advertisement
Guest User

MSP432P401R_16x2_lcd

a guest
Mar 28th, 2020
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.32 KB | None | 0 0
  1. /******************************************************************************
  2.  * Title    : MSP432 Microcontroller Interfacing With 16x2 LCD
  3.  * Author   : Taufiq Dwi Septian Suyadhi
  4.  * Website  : www.robotics-university.com
  5.  *
  6.  * Use the following pins:
  7.  * - P4.2           = EN pin
  8.  * - P4.0           = RS pin
  9.  * - P4.4 - P4.7    = 4 bit data line
  10.  *
  11.  * configuration of pins/port can be modified in the .h file
  12.  *
  13.  * Library  : lcd16x2_msp43x.h and lcd16x2_msp43x.c
  14.  * Author   : Haroldo Amaral - agaelema@globo.com
  15.  * Date     : 2017/12/28
  16.  * URL      : https://github.com/agaelema/LCD16x2_MSP43x
  17.  *****************************************************************************/
  18. #include <msp432.h>
  19. #include <stdint.h>
  20. #include "lcd16x2_msp43x.h"
  21.  
  22. void main(void)
  23. {
  24.     WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;     // stop watchdog timer
  25.  
  26.     P4->DIR = 0xFF;     // make P4 pins as output for data and controls
  27.     P4->OUT = 0x00;     // clear all pins
  28.  
  29.     lcd16x2_Init();                       // initialize LCD
  30.  
  31.     lcd16x2_SetPosition(0,0);             // set position to 1st row, 1st column
  32.     lcd16x2_PrintString("Hi Taufiq!");    // write your text to lcd
  33.  
  34.     lcd16x2_SetPosition(1,0);             // set position to 2nd row, 1st column
  35.     lcd16x2_PrintString("Batam 2020");  // write your text to lcd
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement