2.- Draw a flow diagram that can be used to describe the basic steps needed to r
ID: 2248059 • Letter: 2
Question
2.- Draw a flow diagram that can be used to describe the basic steps needed to read and calculate the conversion from Celsius to Fahrenheit as follows: -In your program, the temperatures in Celsius should be given one at a time by typing their value using the keyboard, and then display the given Celsius and its corresponding value in Fahrenheit on the terminal as follows: Celsius 20, Fahrenheit-68 At the same time, the corresponding binary value for the Fahrenheit Temperature should be displayed in the 8-LED connected to pins 2-9 of the Arduino, so that the LED will display the above Fahrenheit temperature as 0100 0100 3.- Using as reference the flow diagram and the Arduino instruction set, write the C programm that can be used to perform the conversion from Celsius to Fahrenheit.Explanation / Answer
#program:
#include<stdio.h>
int main
{
float Celsius, Fahrenheit;
printf(" enter temperature in Celsius:");
scanf("%f", & Celsius);
Fahrenheit=(1.8*Celsius)+32;
printf(" Temperature in Fahrenheit: %f", Fahrenheit);
return (0);
}
Output:
1
2
Enter temperature in Celsius: 20
Temperature in Fahrenheit: 68
#part 2: LED interfacing with C program
The output from C program is a digital values. Then to use these values as an input for an Arduino Uno, there are some analog input in Arduino.
The program for Arduino Uno to give the results as output on LED:
void setup ( )
{
pinmode(LED, OUTPUT);
}
void loop( )
{
digital Write(LED, HIGH);
delay(0100);
digital Write (LED, LOW);
delay(0100);
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.