Question

EECP3171 - Assignment Sem-3 (2018-19) Submission method: Individual Demonstration of Simulation on Tinkercad Demonstration Sc
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Arduino Code:

#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

#define sensor A0
#define red 6
#define green 7

float SensorInput = 0;
float Temp_Celsius = 0;
float Temp_Fahren = 0;

void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
pinMode(red, OUTPUT);
pinMode(green, OUTPUT);
}

void loop()
{
SensorInput = analogRead(sensor);
Temp_Celsius = SensorInput * 0.48828125;
Temp_Fahren = (Temp_Celsius * 1.8) + 32;
if (Temp_Celsius > 50)
{
digitalWrite(red, 1);
digitalWrite(green, 0);
}
else if (Temp_Celsius < 50)
{
digitalWrite(green, 1);
digitalWrite(red, 0);
}
lcd.setCursor(0, 0);
lcd.print("Celsius: ");
lcd.setCursor(10, 0);
lcd.print(Temp_Celsius);
lcd.setCursor(0, 1);
lcd.print("Fahrenheit: ");
lcd.setCursor(13, 1);
lcd.print(Temp_Celsius);
}

Add a comment
Know the answer?
Add Answer to:
EECP3171 - Assignment Sem-3 (2018-19) Submission method: Individual Demonstration of Simulation on Tinkercad Demonstration Schedule: 20...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT