Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a top-level flowchart for the following code: #include LiquidCrystal lcd(13, 12, 11, 10, 8, 7); int degree; double realDegree; String lcdBuffer; int redled =

Write a top-level flowchart for the following code:

#include

LiquidCrystal lcd(13, 12, 11, 10, 8, 7); int degree; double realDegree; String lcdBuffer; int redled = 1; int greenled = 2; int buzzer = 4; int sensor = A3; int sensorThresh = 400;

void setup() { lcd.begin(16, 2); degree = 0; realDegree = 0; pinMode(redled, OUTPUT); pinMode(greenled,OUTPUT); pinMode(buzzer,OUTPUT); pinMode(sensor,INPUT); }

void loop(){{ lcd.print(" "); degree = analogRead(2); realDegree = (double)degree/1024; realDegree *= 5; realDegree -= 0.5; realDegree *= 100; lcd.setCursor(0,1); String output = String(realDegree) + String((char)178) + "C "; lcd.print(output); lcd.setCursor(0,0); lcd.print("Room Temp:"); }

int analogValue = analogRead(sensor); Serial.print(analogValue); if(analogValue>sensorThresh) { digitalWrite(redled,HIGH); digitalWrite(greenled,LOW); tone(buzzer,1000,10000); lcd.clear(); lcd.setCursor(0,1); lcd.print("ALERT"); delay(1000); lcd.clear(); lcd.setCursor(0,1); lcd.print("EVACUATE"); delay(1000); } else { digitalWrite(greenled,HIGH); digitalWrite(redled,LOW); noTone(buzzer); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

8-15 Explain how a cyberattack can be carried out.

Answered: 1 week ago

Question

The paleolithic age human life, short write up ?

Answered: 1 week ago

Question

=+j Explain IHRMs role in global HR research.

Answered: 1 week ago

Question

=+j Describe an effective crisis management program.

Answered: 1 week ago