Skip to content

Commit

Permalink
epd1in54: add Waveshare 1.54inch B/W e-Paper display (#704)
Browse files Browse the repository at this point in the history
epd1in54: add Waveshare 1.54inch B/W e-Paper display
  • Loading branch information
mbialon authored Oct 23, 2024
1 parent 109cab4 commit ce80e75
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 0 deletions.
36 changes: 36 additions & 0 deletions examples/waveshare-epd/epd1in54/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package main

import (
"image/color"
"machine"

"tinygo.org/x/drivers/waveshare-epd/epd1in54"
"tinygo.org/x/tinyfont"
"tinygo.org/x/tinyfont/gophers"
)

var (
spi0 = machine.SPI0
cs = machine.D10
dc = machine.D9
rst = machine.D6
busy = machine.D5

black = color.RGBA{R: 1, G: 1, B: 1, A: 255}
)

func main() {
display := epd1in54.New(spi0, cs, dc, rst, busy)

display.LDirInit(epd1in54.Config{})
display.Clear()
display.ClearBuffer()

tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 150, 0, "A B C", black, tinyfont.ROTATION_90)
tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 100, 0, "D E F", black, tinyfont.ROTATION_90)
tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 50, 0, "G H I", black, tinyfont.ROTATION_90)
tinyfont.WriteLineRotated(&display, &gophers.Regular58pt, 0, 0, "J K L", black, tinyfont.ROTATION_90)

display.Display()
display.Sleep()
}
1 change: 1 addition & 0 deletions smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/r
tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go
tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go
tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go
tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go
tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go
tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go
tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go
Expand Down
Loading

0 comments on commit ce80e75

Please sign in to comment.