package
0.0.0-20210725070121-48e79472f579
Repository: https://github.com/samarkin/screen-server.git
Documentation: pkg.go.dev
# README
samarkin/screen-server/oled
A simple go library to work with an SH1106 128x64 OLED screen.
Includes a custom 5x7 font.
Usage
-
Ensure the display is properly connected over I2C.
-
Import the module:
import "github.com/samarkin/screen-server/oled"
- Profit:
scr, err := oled.Open(&oled.I2cOpener{})
if err != nil {
log.Fatalf("Failed to open screen: %v", err)
}
defer scr.Close()
scr.Print(0, 0, "Hello, world!")
# Functions
Open is the entry point to start working with an OLED screen.
# Constants
ErrorScreenClosed means an attempt to communicate with a closed OLED screen.
# Variables
SignalLevels holds the number of supported signal levels.
# Structs
I2cOpener allows to open a real I2C screen.
MockOpener allows to open a screen object that does not perform any real connection Can be used for testing.