Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tmsmr/ssd1351
Golang module for SSD1351-based OLED's on a Raspberry Pi
https://github.com/tmsmr/ssd1351
golang oled raspberry-pi ssd1351
Last synced: about 2 months ago
JSON representation
Golang module for SSD1351-based OLED's on a Raspberry Pi
- Host: GitHub
- URL: https://github.com/tmsmr/ssd1351
- Owner: tmsmr
- License: mit
- Created: 2021-11-21T12:32:00.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-27T16:46:19.000Z (about 3 years ago)
- Last Synced: 2024-06-20T17:05:05.176Z (7 months ago)
- Topics: golang, oled, raspberry-pi, ssd1351
- Language: Go
- Homepage:
- Size: 913 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSD1351
*Golang module for SSD1351-based OLED's on a Raspberry Pi**This module was developed for https://www.waveshare.com/wiki/1.5inch_RGB_OLED_Module, but should work with other OLED's (128x128, RGB) based on the SSD1351 as well.*
## Requirements
- A user with access to `/dev/mem` or `/dev/gpiomem` (possibly `root`)
- The `SSD1351` connected to SPI0 (`go-rpi` only supports SPI0 at the moment)## Example usage
| RPi GPIO | OLED |
|----------------|------|
| MOSI0 (GPIO10) | DIN |
| SCLK0 (GPIO11) | CLK |
| CE0 (GPIO8) | CS |
| GPIO24 | DC |
| GPIO25 | RST |```go
import (
"time"
"github.com/tmsmr/ssd1351"
"github.com/stianeikeland/go-rpio/v4"
)...
rstPin := rpio.Pin(25)
csPin := rpio.Pin(8)
dcPin := rpio.Pin(24)
oled, _ := ssd1351.Setup(rpio.Spi0, 0, rstPin, csPin, dcPin, true)
oled.Init()
color := ssd1351.RGBto16bit(0xFF, 0x00, 0x00)
_ = oled.DrawBlock(0, 0, 128, 128, color)
time.Sleep(500 * time.Millisecond)
oled.Shutdown()
```