Question: Write a C program clock that continuously reads lines from stdin and displays them as described above on the LED array. Lines will be of
Write a C program 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. The program must be built from the following files:
- (30 points) display.c : Should have at least the following functions:
- void display_time(int hours, int minutes, int seconds, pi_framebuffer_t *dev) : displays the time on device dev using the below helpers.
- void display_colons(pi_framebuffer_t *dev) : draws the colons
- void display_hours(int hours, pi_framebuffer_t *dev) : displays the hours on device dev as above
- void display_minutes(int minutes, pi_framebuffer_t *dev) : displays the minutes on device dev as above
- void display_seconds(int seconds, pi_framebuffer_t *dev) : displays the seconds on device dev as above
Step by Step Solution
3.48 Rating (141 Votes )
There are 3 Steps involved in it
c include include include include displayh define MAXLINELENGTH 9 int main char li... View full answer
Get step-by-step solutions from verified subject matter experts
