231
{
float t = 0.0;
float p = 0.0;
/* Stop watchdog timer from timing out during initial start-up. */
WDTCTL = WDTPW | WDTHOLD;
/* initialize Config for the MSP430 GPIO */
GPIO_graceInit();
/* initialize Config for the MSP430 2xx family clock systems (BCS) */
BCSplus_graceInit();
/* initialize Config for the MSP430 USCI_A0 */
USCI_A0_graceInit();
/* initialize Config for the MSP430 System Registers */
System_graceInit();
/* initialize Config for the MSP430 WDT+ */
WDTplus_graceInit();
LCD_init();
LCD_clear_home();
lcd_symbol();
LCD_goto(0, 0);
LCD_putstr("P/kPa:");
LCD_goto(0, 1);
LCD_putstr("T/ C :");
LCD_goto(2, 1);
LCD_send(0, DAT);
MPL115A1_init();
while(1)
{
MPL115A1_get_data(&p, &t);
print_F(10, 0, p, 1);
print_F(11, 1, t, 1);
delay_ms(400);
};
}
void GPIO_graceInit(void)
{
/* USER CODE START (section: GPIO_graceInit_prologue) */
/* User initialization code */
/* USER CODE END (section: GPIO_graceInit_prologue) */
/* Port 1 Port Select 2 Register */
P1SEL2 = BIT1 | BIT2 | BIT4;
/* Port 1 Output Register */
P1OUT = 0;
/* Port 1 Port Select Register */
P1SEL = BIT1 | BIT2 | BIT4;