Skip to content

Commit ce80e75

Browse files
authored
epd1in54: add Waveshare 1.54inch B/W e-Paper display (#704)
epd1in54: add Waveshare 1.54inch B/W e-Paper display
1 parent 109cab4 commit ce80e75

File tree

4 files changed

+513
-0
lines changed

4 files changed

+513
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package main
2+
3+
import (
4+
"image/color"
5+
"machine"
6+
7+
"tinygo.org/x/drivers/waveshare-epd/epd1in54"
8+
"tinygo.org/x/tinyfont"
9+
"tinygo.org/x/tinyfont/gophers"
10+
)
11+
12+
var (
13+
spi0 = machine.SPI0
14+
cs = machine.D10
15+
dc = machine.D9
16+
rst = machine.D6
17+
busy = machine.D5
18+
19+
black = color.RGBA{R: 1, G: 1, B: 1, A: 255}
20+
)
21+
22+
func main() {
23+
display := epd1in54.New(spi0, cs, dc, rst, busy)
24+
25+
display.LDirInit(epd1in54.Config{})
26+
display.Clear()
27+
display.ClearBuffer()
28+
29+
tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 150, 0, "A B C", black, tinyfont.ROTATION_90)
30+
tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 100, 0, "D E F", black, tinyfont.ROTATION_90)
31+
tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 50, 0, "G H I", black, tinyfont.ROTATION_90)
32+
tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 0, 0, "J K L", black, tinyfont.ROTATION_90)
33+
34+
display.Display()
35+
display.Sleep()
36+
}

smoketest.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/r
7777
tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go
7878
tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go
7979
tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go
80+
tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go
8081
tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go
8182
tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go
8283
tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go

0 commit comments

Comments
 (0)