goflipdot π
Welcome to the goflipdot repository! This project is designed to manage and control Hanover flipdot displays via a Go-based interface.
Summary of Project π
The goflipdot repository provides an easy-to-use interface for connecting, configuring, and controlling Hanover flipdot signs. It includes:
- A command-line example to run and test the flipdot display.
- Internal packages to handle different aspects of the flipdot communication and control.
- Unit tests to ensure the reliability and correctness of the code.
History
This is a port of pyflipdot
to Go. The original pyflipdot
project can be found here.
pyflipdot
was built based off of John Whittington's blog post and his node.js driver node-flipdot
How to Use π
Setup
-
Clone the repository:
git clone https://github.com/harperreed/goflipdot.git
cd goflipdot
-
Build the project:
make build
-
(Optional) Run tests to make sure everything is working:
make test
Running the Example
To run the example command-line application:
make run-example
This will start the test sequence on the connected flipdot sign and draw a checkerboard pattern.
Tech Info βοΈ
-
This project is written in Go, so make sure you have Go installed.
-
The code is organized into several packages:
cmd
: Contains the example command-line application.
internal
: Houses the internal logic for controllers, packets, and signs.
pkg
: Provides the main public interface for controlling flipdot signs.
test
: Includes unit tests for the different components.
Testing
While unit tests are provided in the test/
directory, it's crucial to test the library with actual Hanover flipdot hardware to ensure proper functionality. The provided tests use mocks and don't account for potential hardware-specific issues.
When testing with real hardware:
- Ensure proper serial port configuration.
- Verify that packets are being sent in the correct format.
- Check for any responses from the display and handle them appropriately.
- Test various display sizes and configurations to ensure compatibility.
Directory/File Tree
goflipdot/
βββ Makefile
βββ cmd
β βββ example
β βββ main.go
βββ go.mod
βββ internal
β βββ controller
β β βββ controller.go
β βββ packet
β β βββ packet.go
β βββ sign
β βββ sign.go
βββ pkg
β βββ goflipdot
β βββ goflipdot.go
βββ test
βββ controller_test.go
βββ packet_test.go
βββ sign_test.go
File Content Overview
- Makefile
- Provides basic commands for building, testing, cleaning, and formatting the project.
- cmd/example/main.go
- Example command-line application to interact with the flipdot signs.
- go.mod
- The Go module file for dependency management.
- internal/controller/controller.go
- Contains the logic for managing the communications with the flipdot signs.
- internal/packet/packet.go
- Defines packets used to communicate with the flipdot signs.
- internal/sign/sign.go
- Includes the logic for creating and manipulating flipdot sign properties.
- pkg/goflipdot/goflipdot.go
- Main public interface providing higher-level functions for use by other applications.
- test/controller_test.go
- Unit tests for the controller logic.
- test/packet_test.go
- Unit tests for the packet structures and behaviors.
- test/sign_test.go
- Unit tests for the sign-related logic.
We hope this README has provided you with the needed information to get started with our project. Happy coding! π»