Answered step by step
Verified Expert Solution
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 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!
points a Bash script clock.sh that oncesecond will print the time in the 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.
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 MM and SS will range from and the separating :: are mandatory. Do not include clock in your repository, only these files:
points display.c : Should have at least the following functions other helper functions may be added as desired:
int opendisplayvoid : 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 if something went wrong in opening the display or if a display has already been opened and not closed 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 piframebuffer is a good idea.
void displaytimeint hours, int minutes, int seconds : displays the time on the opened device using the below helpers.
void displaycolonsvoid : draws the colons
void displayhoursint hours : displays the hours
void displayminutesint minutes : displays the minutes
void displaysecondsint seconds : displays the seconds
void closedisplayvoid : This function should only be called once when the program is ending to take care of shutting down the display.
points display.h : prototypes for all above functions for use in main.c below.
points main.c : contains main function, which either by itself, or using a helper continuously reads lines from stdin and displays them using displaytime 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 controlC to exit the program.
points a Makefile with at least the following rules
Rules to compile c files into o files displayo 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 controlC 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started