Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your repository must have the following files and no other! You will lose 5 points for each extra file in the repository. A text file

Your repository must have the following files and no other! You will lose 5 points for each extra file in the repository.
A text file README (or README.md) that lists partners' names, UD email addresses, and Student ID #s. You may receive no credit if this file is not present!
(20 points) a Bash script clock.sh that once/second will print the time in the 24-hour clock format HH:MM:SS. See "man date" for a command to produce this format of time. See "Basic shell scripts" for enough background to put this together.
(60 points) The following files will be used to build a program called clock that continuously reads lines from stdin and displays them as described above on the LED array. Lines will be of the form HH:MM:SS; HH will range from 0-23, MM and SS will range from 0-59, and the separating :: are mandatory. Do not include clock in your repository, only these files:
(30 points) display.c : Should have at least the following functions (other helper functions may be added as desired):
int open_display(void) : This function should be called only once when the program starts up. Create a suitable environment to draw the clock as described below. It should return 0 if something went wrong in opening the display or if a display has already been opened (and not closed),1 if successful. Be sure to check the return from getFrameBuffer().
Note: while global variables are frequently a bad idea, in C, variables declared in a file outside a function are "global" only to that file. Using one for your pi_framebuffer is a good idea.
void display_time(int hours, int minutes, int seconds) : displays the time on the opened device using the below helpers.
void display_colons(void) : draws the colons
void display_hours(int hours) : displays the hours
void display_minutes(int minutes) : displays the minutes
void display_seconds(int seconds) : displays the seconds
void close_display(void) : This function should only be called once when the program is ending to take care of shutting down the display.
(5 points) display.h : prototypes for all above functions for use in main.c below.
(25 points) main.c : contains main function, which (either by itself, or using a helper) continuously reads lines from stdin and displays them using display_time as described above. When the program reads fewer than three values, it should clear the display and exit. Don't forget that scanf can read patterns! Note: when stdin is coming from other than the terminal (like from the clock.sh script), you'll need to use ^C (control-C) to exit the program.
(20 points) a Makefile with (at least) the following rules
Rules to compile .c files into .o files (display.o and main.o)
An all rule that will combine all .o files into an executable clockdisplay
A clean rule that will remove the executable clockdisplay and all .o files
A run rule that will run the script and pipe the output into the clockdisplay binary. Note: you'll need to hit control-C to make this stop. The screen may not clear, and you will get an error message message from make. That's okay.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

licensure as a psychologist in the respective jurisdiction; and

Answered: 1 week ago

Question

What is the main advantage to this tactic?

Answered: 1 week ago

Question

What administrative cost items are associated with this tactic?

Answered: 1 week ago

Question

What is the full-cost budget?

Answered: 1 week ago