goflipdot

module
v0.0.0-...-41f10ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2024 License: MIT

README ΒΆ

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
  1. Clone the repository:

    git clone https://github.com/harperreed/goflipdot.git
    cd goflipdot
    
  2. Build the project:

    make build
    
  3. (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:

    1. Ensure proper serial port configuration.
    2. Verify that packets are being sent in the correct format.
    3. Check for any responses from the display and handle them appropriately.
    4. 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! πŸ’»

Directories ΒΆ

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL