
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Modify the code to add a push button:
Once the code runs it should display the temperature in Fahrenheit only in the serial monitor and when the pus button is pressed the temperature should convert to Celsius . And when it pressed again it should go back to Fahrenheit. 
Right now the code is working but it’s showing the temperature both in cel and Fahrenheit together in the serial monitor . Please modify as asked. Thanks

Transcribed Image Text:#include<math.h>
#define pb 13
int i;
int x=0;
void setup()
{
Serial.begin(9600);
pinMode(pb, INPUT_PULLUP);
}
void loop()
{
i=analogRead(A0);
Thermister(i);
delay(1000);
}|
double Thermister(int data) {
double temp;
temp-log(10000.0*((1024.0/data-1)));
temp=1/(0.001129148+(0.000234125+(0.0000000876741*temp*temp))*temp);
temp-temp-273.15;
Serial.println(" ");
Serial.print(temp);
Serial.print(" Celcius");
Serial.println(" ");
Serial.println(".
temp=(temp*9.0)/5.0+32.0;
Serial.println(" ");
Serial.print(temp);
Serial.print(" Fahrenheit");
Serial.println(" ");
Serial.println(".
}
.");
.");
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- What do you want to print on the back of shirt 1: What do you want to print on the back of shirt 2. What do you want to print on the back of shirt 3: Enter the number of T-Shirts to purchase: I am using a for loop to take user input and trying to get where What do you want to print on the back of shirt 3 and Enter the number of T- Shirts, which is the start of another loop on separate lines in Javaarrow_forwardBlinking We want to create a program that continuously turns pin 13 ON waits for 1second then turns pin 13 OFF, then waits 1 second and turns pin 13 back ON. Write the Arduino code with comments to control the pin 13. Blinking We want to create a program that continuously turns pin 13 ON waits for 1second then turns pin 13 OFF, then waits 1 second and turns pin 13 back ON. Write the Arduino code with comments to control the pin 13.arrow_forwardThis is a python code Fix these issues: -1 1. Checking: handleCheckMenu: Why check for option 4? It'll never get into the while loop if the choice is 4! -3 2. Savings Menu After any option in savings menu, sends back to main. Why? Should continue displaying savings menu until user selects "Back to Main" option. Interest should be calculated using 2%. Your program uses 20% -3 3. While in checking menu, after deposit, sends back to main. Why? After any option in checking menu, sends back to main. Why? Should continue displaying checking menu until user selects "Back to Main" option. Checking menu: enters infinite loop if user enters 9 for the choice: Checking Menu1. Deposit2. Withdrawal3. Display Checking Balance4. Return to Main Menu Enter a choice: 9 ================================== def createMenu(listOfChoices, MenuTitle):ct = 1MenuTitle += '\n' for i in listOfChoices:choice = str(ct) + '. ' + i + '\n'MenuTitle += choicect += 1return…arrow_forward
- Please solve this question queckly with visual basicarrow_forwardYou want the output to be: one line of vertical bars, spaced so that they always appear above the 0 in the line of numbers, then the line of numbers. You should define one constant in your code that you use to: 1.) set the number of spaces between vertical bars. 2.) set the sequence of numbers to restart at zero. If the value of your constant is 3, the output should look like: ||| 123012301230123 etc.arrow_forwardPlease help with solving this problem. In the screenshots you will see the question and my attempt to solve it. In my attempt to solve the problem I realized that I was missing a period after "2009" so when I added the period I still got an error message in which the contents of the error message changed and it said: you displayed:Enter◦'boy',◦'girl',◦or◦'both':Enter◦a◦boy's◦name:Enter◦a◦girl's◦name:Andrew◦was◦a◦popular◦boy's◦name◦between◦2000◦and◦2009.⏎Emma◦was◦a◦popular◦girl's◦name◦between◦2000◦and◦2009.⏎instead of:Enter◦'boy',◦'girl',◦or◦'both':Enter◦a◦boy's◦name:Andrew◦was◦a◦popular◦boy's◦name◦between◦2000◦and◦2009.⏎Enter◦a◦girl's◦name:Emma◦was◦a◦popular◦girl's◦name◦between◦2000◦and◦2009.⏎arrow_forward
- Hi currently need help with editing this code. My professor said my code needs to have if, if-else, and if-else if statements in it. From what it looks like I'm missing if-else-if statements in my code. I need help with editing the code with if-else-if statements including any other "if or if-else" if needed in the code. I provided pictures of the code instructions and how the output and input validation needs to look. here's the code I currently have: #include <iostream>#include <string>#include <cmath>using namespace std;int main(){//variables and constantsint packageType;double dataUsed;double monthlyCharges = 0.0; // Name of the programcout << "iMobile Bill Calculator ..." << endl; // Display the pacakge options for user to pick while (true) {cout << "\nSelect a subscription :" << endl;;cout << "\t\t1. Package A" << endl;cout << "\t\t2. Package B" << endl;cout << "\t\t3. Package C" << endl;cout <<…arrow_forwardTrace the following flowchart and complete the Table l (fill in ALL the blanks). Start 13 is Dinplay Display DO NOT leave the blank spoce. If the value of the varioble is not changed, fill the blank with the same value. Table 1 n<15 in/2 Outputarrow_forwardCreate a flowchart that will determine if the patient has COVID-19 or not. Consider the three primary symptoms (fever, cough and shortness of breath) note: if all symptoms manifest on the patient print "ALERT Required to be quarantine and Hospitalize ". if one of the symptoms manifest print "Home Quarantine and observation for 7 days". If two of the symptoms manifest print "Inform the Officials and quarantine for 14 days" *arrow_forward
- Create a fully documented java applet that produces a Bulls Eye with six concentriccircles using two colors as shown below. You may choose your own color combination.(See pg. 260, Programming Project 13, Savitch).Use Named Constants to establish and maintain the x and y settings for the top leftcorner and the amount to change the diameter for each circle.Use a for loop to control the drawing of each of the 6 circles. Within the loop, determinethe correct graphic settings for the fillOval method by increasing the x, y values to moveinward; reducing the diameter for the new circle and alternating the color setting.hint: to determine color setting LoopCtr % 2 will alternate between 0 and 1Test your code using the AppletViewerarrow_forwardSet up a password variable in your C# application and assign a password to this variable. Run your program and type in invalid passwords to check and see if your boolean logic is correct. Once the correct password is typed, the program should stop asking for input. You should do this by utilizing a while loop or a do while loop. Sample output is below: Enter the password :: hello INVALID Enter the password :: hacker INVALID Enter the password :: i INVALID Enter the password :: am INVALID Enter the password :: a INVALID Enter the password :: hacker INVALID Enter the password :: taylor INVALID Enter the password :: go INVALID Enter the password :: swift INVALID Enter the password :: taylorswift INVALID Enter the password :: taylorswiftchiefs INVALID Enter the password :: taylorswiftgoingtothesuperbowl VALIDarrow_forwardAn error message popped up when I tried to run the code. "deposit" is not defined "withdraw" is not defined *it was run on visual codearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY