Learn how the C code reads the CSV file, extracting each data element and saving it into a structure. The timestamp from the CSV file is converted into a time_t or Unix Epoch value. When the machine's current time matches the timestamp time, records are output one line at a time. The ncurses version of the code creates a full-screen dashboard with scrolling time and an engine efficiency thermometer.
- [Narrator] My first solution doesn't…really use a dashboard,…which is okay for a basic C program.…The core of the main function…involves reading the data file,…which I assume is unmodified from the original.…The first row, the header row,…is discarded at line 53.…And at line 56, the current time is saved.…The bulk of the function involves the while loop at line 58.…A record is fetched from the buffer,…and the extract function is called,…which pulls out all the fields,…and saves them into a data structure.…
By this point, the time stamp has been converted…into a time tr unix epoch time value,…and if the current time value equals…the value posted in the data file,…each field is output,…one line at a time.…A nested while loop at line 78…waits for the machine's next second to pop up,…at which point the loop repeats,…and the next record is read from the file.…The extract function at line 88…takes the text string red from the file…and slices it up into individual pieces.…
First, the timestamp string is changed to a time_t,…
Skill Level Intermediate
1. Summarize the Weather
2. Geolocation with C
3. Eight Queens with C
4. Build a Musical Instrument with C
5. Face Recognition with C
6. Web Dashboards with C
Next steps1m 2s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.