https://github.com/Nondzu/ssd1306_font
OLED ssd1306 font library using TinyGo
https://github.com/Nondzu/ssd1306_font
embedded font golang oled oled-display oled-display-ssd1306 oled-ssd1306 pico raspberry rpi tinygo
Last synced: 4 months ago
JSON representation
OLED ssd1306 font library using TinyGo
- Host: GitHub
- URL: https://github.com/Nondzu/ssd1306_font
- Owner: Nondzu
- License: mit
- Created: 2022-08-23T10:14:44.000Z (over 3 years ago)
- Default Branch: release
- Last Pushed: 2022-08-23T11:55:01.000Z (over 3 years ago)
- Last Synced: 2024-12-12T23:02:40.713Z (12 months ago)
- Topics: embedded, font, golang, oled, oled-display, oled-display-ssd1306, oled-ssd1306, pico, raspberry, rpi, tinygo
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tinygo - SSD1306 font - Lite SSD1306 OLED font library using TinyGo. (Display Hardware)
README
# ssd1306 font
### This is lite ssd1306 font library using TinyGo. Tested on Raspberry Pi Pico.
Example:
```
package main
import (
"machine"
"time"
font "github.com/Nondzu/ssd1306_font"
"tinygo.org/x/drivers/ssd1306"
)
func main() {
time.Sleep(time.Millisecond * 100) // Please wait some time after turning on the device to properly initialize the display
machine.I2C0.Configure(machine.I2CConfig{Frequency: 400000})
// Display
dev := ssd1306.NewI2C(machine.I2C0)
dev.Configure(ssd1306.Config{Width: 128, Height: 64, Address: 0x3C, VccState: ssd1306.SWITCHCAPVCC})
dev.ClearBuffer()
dev.ClearDisplay()
//font library init
display := font.NewDisplay(dev)
display.Configure(font.Config{FontType: font.FONT_7x10}) //set font here
display.YPos = 20 // set position Y
display.XPos = 0 // set position X
display.PrintText("HELLO WORLD!") // print text
for {
}
}
```
#### FONT_6x8

#### FONT_7x10

#### FONT_11x18

#### FONT_16x26
