Digital Thermometer On Demand In this lab, you will re-design the digital clock
ID: 2079123 • Letter: D
Question
Digital Thermometer On Demand
In this lab, you will re-design the digital clock in Lab 7 of the lab with the capability of digital thermometer upon the push of a push button.
Study carefully chapter 9 regarding the interrupts and timers
Reuse the hardware connection from Lab 6 for the SEN-11931 and the LCD digital clock display from Lab 7. Design a way of using the pushbutton to trigger an interrupt to your system. Your system, upon receiving this interrupt, responds by reading and displaying the temperature in Fahrenheit degrees on the LCD display in the format of xxx.x. The system must resume displaying the digital clock. Build your circuit and include all the required information about your hardware design in your lab report.
Based on the hardware you designed, choose an interrupt/timer tool from mbed to update the LCD display with the digital clock HH:MM:SS every second with the correct time of second, minute and hour. You must NOT have any code for counting or displaying the clock display with hour, minute or second in the main() function other than setting the clock display to 00:00:00 at start up. This means, you should use a timing tool (interrupt or timer) to update the clock display rather than using wait(1) for waiting for 1 second as we did in Lab 7. Whenever the user pushes on the push button and releases it, the system will respond to it by measuring the current temperature and displaying the temperature to the LCD for approximately 1 second. Then the system shall resume the display of the current digital time. Keep in mind, the clock should continue counting as if the temperature reading was never done instead of restarting from 00:00:00.
Test your system and explain your testing process and how you use your test results to confirm that your system functions properly.
The below is the digial clock syntax:
#include "mbed.h"
#include "TextLCD.h"
TextLCD lcd(p15, p16, p17, p18, p19, p20);
int hours, minutes, seconds;
int main() {
hours=0;
minutes=0;
seconds=0;
while(1){
if(seconds==60){
seconds=0;
minutes++;
}
if(minutes==60){
minutes=0;
hours++;
}
if(hours==24){
hours=0;
}
lcd.locate(0, 1); // row 1, column 0
lcd.printf("%02d:%02d:%02d", hours, minutes, seconds); //to printing the values in lcd
seconds++; //second increases after one second
wait(1);
//wait apply for wait one second
}
}
Explanation / Answer
Is this a practical based question ? How can this be done if references are from other chapters which are unknown to us. Please let me know what to be done.