Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sadteeto/vfd_clock


https://github.com/sadteeto/vfd_clock

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

This C++ code is for an ESP32-S3 Arduino-based project that uses a Vacuum Fluorescent Display (VFD) to display GPS time data. The code uses the FreeRTOS real-time operating system to manage tasks and queues, and the SPI (Serial Peripheral Interface) protocol for communication with the VFD.

The code begins by including necessary libraries and defining global variables and function prototypes. The [`ubloxConfig`](src/main.cpp) array is used to configure the GPS module. The [`empty_screen`](src/main.cpp) structure is used to clear the VFD screen. The [`vfdspi`](src/main.cpp) handle is used for SPI communication with the VFD. The [`xVFDQueue`]("src/main.cpp) is a queue for managing the data to be displayed on the VFD.

The [`setup()`](src/main.cpp) function initializes the system. It sets up the serial communication, configures the SPI bus and device, clears the VFD screen, creates the VFD queue, and creates two tasks: `vGpsTask` and `vVfdUpdateTask`.

The [`loop()`](src/main.cpp) function is empty because all the work is done in the tasks.

The `vVfdUpdateTask` function is a task that updates the VFD display. It reads data from the queue and sends it to the VFD via SPI. It also toggles the VFLOAD pin to update the display.

The `vGpsTask` function is a task that reads GPS data from the serial port, extracts the time information, adjusts the time based on the timezone settings, formats the time as HH-MM-SS, converts the formatted time to segment values for displaying on the VFD, and sends the segment values to the VFD display update task using a queue.

The `getSegmentShow()` function returns the segment value to show on a display for a given character.

The [`clearScreen()`]( src/main.cpp) function clears the screen of the VFD display by transmitting the [`empty_screen`](src/main.cpp) data to the VFD via SPI and toggling the VFLOAD pin.