Skip to content

caseymrm/flipdots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flipdots in Go

This library handles controlling Flip-Dot Boards by Alfa-Zeta from Go. It should work on Mac, Linux, and Windows, but has been primarily tested on Mac with a 7x7 USB panel.

Simple example:

package main

import (
    "math/rand"
    "time"

    "github.com/caseymrm/flipdots/panel"
)

func main() {
    p := panel.NewPanel(7, 7, "/dev/tty.usbserial-A505J9SE", 9600)
    defer p.Close()

    for i := 0; i < 20; i++ {
        for x := 0; x < p.Width; x++ {
            for y := 0; y < p.Height; y++ {
                p.Set(x, y, rand.Intn(2) == 0)
            }
        }
        log.Printf("Sending panel %d/20", i+1)
        p.Send()
        time.Sleep(200 * time.Millisecond)
    }
}

Output

Letter drawing:

package main

import (
	"flag"
	"time"

	"github.com/caseymrm/flipdots/panel"
	"github.com/caseymrm/flipdots/text"
)

func main() {
    p := panel.NewPanel(7, 7, "/dev/tty.usbserial-A505J9SE", 9600)
	defer p.Close()

	f := text.GetFont(7)
	str := "Hello world"
	for i := 0; i < len(str); i++ {
		f.Draw(p, 0, 0, string(str[i]))
		p.Send()
		time.Sleep(200 * time.Millisecond)
	}
}

About

Go implementation of the Alfa-Zeta flip-dot boards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages