scootpl / uprint

uPrint (microPrint) is a simple TinyGo library to print text on OLED display. Drivers implementing 'drivers.Displayer' are supported. Tested on Raspberry Pi Pico and ssd1306.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uPrint

uPrint (microPrint) is a simple TinyGo library to print text on OLED display. Drivers implementing 'drivers.Displayer' are supported. Tested on Raspberry Pi Pico and ssd1306.

Example

	machine.SPI0.Configure(machine.SPIConfig{
		Frequency: 10 * 1024 * 1024,
	})

	time.Sleep(time.Second)

	device := ssd1306.NewSPI(machine.SPI0, machine.Pin(17), machine.Pin(20), machine.Pin(16))
	device.Configure(ssd1306.Config{})

	device.ClearDisplay()

	p := uprint.New(&device, "font7x10")
	p.Print("Hello!", 0, 0, color.RGBA{R: 0xff, G: 0xff, B: 0xff, A: 0xff})

	device.Display()

	for {
		time.Sleep(time.Second)
	}

fonts downloaded from: https://github.com/Nondzu/ssd1306_font

About

uPrint (microPrint) is a simple TinyGo library to print text on OLED display. Drivers implementing 'drivers.Displayer' are supported. Tested on Raspberry Pi Pico and ssd1306.

License:MIT License


Languages

Language:Go 100.0%