#include "driverlib.h" #include "delay.h" #include "DHT11.h" #include "lcd.h" #include "lcd_print.h" extern unsigned char values[0x05]; void clock_init(void); void main(void) {     unsigned c

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

I ONLY NEED THE ALGORITHM IN STEPS FOR THIS CODE 

 

main.c

#include "driverlib.h"

#include "delay.h"

#include "DHT11.h"

#include "lcd.h"

#include "lcd_print.h"

extern unsigned char values[0x05];

void clock_init(void);

void main(void)

{

    unsigned char state = 0;

    WDT_A_hold(WDT_A_BASE);

    clock_init();

    LCD_init();

    load_custom_symbol();

    DHT11_init();

    while(1)

    {

        state = get_data();

        switch(state)

        {

            case 1:

            {

            }

            case 2:

            {

                 LCD_clear_home();

                 LCD_putstr("No Sensor Found!");

                 break;

            }

            case 3:

            {

                 LCD_clear_home();

                 LCD_putstr("Checksum Error!");

                 break;

            }

            default:

            {

                 LCD_goto(0, 0);

                 LCD_putstr("R.H/ %:       ");

                 print_C(13, 0, values[0]);

                 LCD_goto(0, 1);

                 LCD_putstr("Tmp/");

                 print_symbol(4, 1, 0);

                 LCD_goto(5, 1);

                 LCD_putstr("C:");

                 if((values[2] & 0x80) == 1)

                 {

                     LCD_goto(13, 1);

                     LCD_putstr("-");

                 }

                 else

                 {

                     LCD_goto(13, 1);

                     LCD_putstr(" ");

                 }

                 print_C(13, 1, values[2]);

                 break;

            }

        }

        delay_ms(1000);

    };

}

void clock_init(void)

{

    PMM_setVCore(PMM_CORE_LEVEL_3);

    GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5,

                                               (GPIO_PIN4 | GPIO_PIN2));

    GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P5,

                                                (GPIO_PIN5 | GPIO_PIN3));

    UCS_setExternalClockSource(XT1_FREQ,

                               XT2_FREQ);

    UCS_turnOnXT2(UCS_XT2_DRIVE_4MHZ_8MHZ);

    UCS_turnOnLFXT1(UCS_XT1_DRIVE_0,

                    UCS_XCAP_3);

    UCS_initClockSignal(UCS_MCLK,

                        UCS_XT2CLK_SELECT,

                        UCS_CLOCK_DIVIDER_1);

    UCS_initClockSignal(UCS_SMCLK,

                        UCS_REFOCLK_SELECT,

                        UCS_CLOCK_DIVIDER_1);

    UCS_initClockSignal(UCS_ACLK,

                        UCS_XT1CLK_SELECT,

                        UCS_CLOCK_DIVIDER_1);

}

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education