298
void main(void)
{
unsigned int LX = 0x0000;
unsigned int tmp = 0x0000;
/* 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_B0 */
USCI_B0_graceInit();
/* initialize Config for the MSP430 System Registers */
System_graceInit();
/* initialize Config for the MSP430 WDT+ */
WDTplus_graceInit();
BH1750_init();
LCD_init();
LCD_clear_home();
LCD_goto(0, 0);
LCD_putstr("MSP430G USCI I2C");
LCD_goto(0, 1);
LCD_putstr("Lux:");
while(1)
{
tmp = get_lux_value(cont_H_res_mode1, 20);
if(tmp > 10)
{
LX = tmp;
}
else
{
LX = get_lux_value(cont_H_res_mode1, 140);
}
lcd_print(11, 1, LX);
delay_ms(200);
}
}
void GPIO_graceInit(void)
{
/* USER CODE START (section: GPIO_graceInit_prologue) */
/* User initialization code */