358
void GPIO_graceInit(void);
void BCSplus_graceInit(void);
void System_graceInit(void);
void WDTplus_graceInit(void);
void lcd_symbol(void);
void print_C(unsigned char x_pos, unsigned char y_pos, signed int value);
void print_I(unsigned char x_pos, unsigned char y_pos, signed long value);
void print_D(unsigned char x_pos, unsigned char y_pos, signed int value, unsigned
char points);
void print_F(unsigned char x_pos, unsigned char y_pos, float value, unsigned char
points);
void main(void)
{
float value = 0.0;
unsigned char state = 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 System Registers */
System_graceInit();
/* initialize Config for the MSP430 WDT+ */
WDTplus_graceInit();
DHT22_init();
LCD_init();
lcd_symbol();
while(1)
{
state = DHT22_get_data();
switch(state)
{
case 1:
{
LCD_goto(0, 0);
LCD_putstr("No Sensor Found!");
LCD_goto(0, 1);
LCD_putstr(" ");
break;
}
case 2:
{
LCD_goto(0, 0);
LCD_putstr("Checksum Error!");
LCD_goto(0, 1);
LCD_putstr(" ");