Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

artvel/display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

16 Commits

Repository files navigation

Mini Display controller

Currently supported displays:

Completion Device
100% Qnap TVS-x72XT
100% Asustor AS6404T

Asustor

Other Qnap or Asustor devices should be compatible too I think.

Example usage:

package main
import (
	"github.com/artvel/display"
	"fmt"
	"time"
)
func main() {
	l := display.Find()
	defer func() {
		panicCheck(l.Close())
	}()
	panicCheck(l.Write(0, "The first line?"))
	panicCheck(l.Write(1, "Hello second line"))
	go l.Listen(func(btn int, released bool) bool {
		_ = l.Write(0, "button clicked")
		_ = l.Write(1, fmt.Sprintf("id:%d, released:%v", btn, released))
		return true
	})
	time.Sleep(20 * time.Second) //wait 20sec for testing the button events
	panicCheck(l.Enable(false)) //disable.. turn off the display
	time.Sleep(5 * time.Second)
}
func panicCheck(err error){
	if err != nil {
		panic(err)
	}
}

Todo

  • add more implementation of other displays

PR's are welcome! Use it as you please.

Have fun.

Releases

No releases published

Packages

No packages published

Languages

AltStyle によって変換されたページ (->オリジナル) /