2. The C program in Figure 1 is to show the elapsed time on LCD display in seconds. The program uses a Ticker with a period of 10ms to control system timing. (1) Modify the program such that it uses a time base of 1 ms to drive the clock. (2) Modify the program in such a way displays elapsed time in hours, minutes and seconds.
Operations
In mathematics and computer science, an operation is an event that is carried out to satisfy a given task. Basic operations of a computer system are input, processing, output, storage, and control.
Basic Operators
An operator is a symbol that indicates an operation to be performed. We are familiar with operators in mathematics; operators used in computer programming are—in many ways—similar to mathematical operators.
Division Operator
We all learnt about division—and the division operator—in school. You probably know of both these symbols as representing division:
Modulus Operator
Modulus can be represented either as (mod or modulo) in computing operation. Modulus comes under arithmetic operations. Any number or variable which produces absolute value is modulus functionality. Magnitude of any function is totally changed by modulo operator as it changes even negative value to positive.
Operators
In the realm of programming, operators refer to the symbols that perform some function. They are tasked with instructing the compiler on the type of action that needs to be performed on the values passed as operands. Operators can be used in mathematical formulas and equations. In programming languages like Python, C, and Java, a variety of operators are defined.
![#include "mbed.h"
#include "C12832_lcd.h"
int counter = 0, seconds = 0;
int flag = 0;
C12832_LCD lcd;
Ticker tick;
void T1_isr ()
{
counter++;
if (counter >= 100)
}
seconds++;
counter = 0;
flag = 1;
int main(){
// clock tick
//1 second has passed?
while(1) {
// Yes increment seconds
// reset counter
// set flag to update display
tick.attach_us(&T1_isr, 10000);
lcd.cls();
lcd.locate(0,0);
lcd.printf("Elapsed Time Monitor"); //print header
while (flag == 0);
lcd.locate(0,15);
lcd.printf("Elapsed Seconds: %d", seconds);
flag = 0; //reset flag
}
Figure 1
// wait for new data](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe0a046d9-778a-4fd5-8482-f50cf499a790%2Fe56a7820-a4b9-4a54-91d4-d9742e7b963f%2Fuzniqzw_processed.png&w=3840&q=75)
![2. The C program in Figure 1 is to show the elapsed time on LCD display in seconds. The
program uses a Ticker with a period of 10ms to control system timing.
(1) Modify the program such that it uses a time base of 1 ms to drive the clock.
(2) Modify the program in such a way displays elapsed time in hours, minutes and seconds.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fe0a046d9-778a-4fd5-8482-f50cf499a790%2Fe56a7820-a4b9-4a54-91d4-d9742e7b963f%2F3hupl5i_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)