From a6c4ce7b517784f63e54ae2f431c64f576cb9ddc Mon Sep 17 00:00:00 2001 From: sago35 Date: Fri, 30 Jan 2026 09:40:53 +0900 Subject: [PATCH 1/3] go mod --- go.mod | 8 ++++---- go.sum | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index db35ad4..abc1061 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ module github.com/tinygo-keeb/workshop -go 1.22.5 +go 1.24.0 require ( - github.com/tinygo-org/pio v0.0.0-20240626192653-0b4cbef45f9b - tinygo.org/x/drivers v0.28.1-0.20240825183126-07216d3051aa + github.com/tinygo-org/pio v0.2.0 + tinygo.org/x/drivers v0.34.0 tinygo.org/x/tinydraw v0.4.0 - tinygo.org/x/tinyfont v0.4.1-0.20241022105211-0b3702cd6364 + tinygo.org/x/tinyfont v0.6.0 ) require github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect diff --git a/go.sum b/go.sum index 1e8be2a..6109f2c 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,10 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/tinygo-org/pio v0.0.0-20240626192653-0b4cbef45f9b h1:ahoIWyyWUM8F+eDRzA2FS7gKiu9Tk/Lyacv7z3nn+Fg= -github.com/tinygo-org/pio v0.0.0-20240626192653-0b4cbef45f9b/go.mod h1:LU7Dw00NJ+N86QkeTGjMLNkYcEYMor6wTDpTCu0EaH8= -tinygo.org/x/drivers v0.28.1-0.20240825183126-07216d3051aa h1:VAGopJUSKAXwdlyBR4pGXXPRIB/zknO7f59QoLfyRZk= -tinygo.org/x/drivers v0.28.1-0.20240825183126-07216d3051aa/go.mod h1:q/mU8G/wz821p8xXqbkBACOlmZFDHXd//DnYnCW+dDQ= +github.com/tinygo-org/pio v0.2.0 h1:vo3xa6xDZ2rVtxrks/KcTZHF3qq4lyWOntvEvl2pOhU= +github.com/tinygo-org/pio v0.2.0/go.mod h1:LU7Dw00NJ+N86QkeTGjMLNkYcEYMor6wTDpTCu0EaH8= +tinygo.org/x/drivers v0.34.0 h1:lw8ePJeUSn9oICKBvQXHC9TIE+J00OfXfkGTrpXM9Iw= +tinygo.org/x/drivers v0.34.0/go.mod h1:ZdErNrApSABdVXjA1RejD67R8SNRI6RKVfYgQDZtKtk= tinygo.org/x/tinydraw v0.4.0 h1:U9V0mHz8/jPShKjlh199vCfq1ARFyUOD1b+FfqIwV8c= tinygo.org/x/tinydraw v0.4.0/go.mod h1:WCV/EMljTv8w04iAxjv+fRD6/4ffx0afATYeJlN90Yo= -tinygo.org/x/tinyfont v0.4.1-0.20241022105211-0b3702cd6364 h1:dYjlzfKPssWsVKfGUp1rPmsvErVc/cE5WB2OviNbsJ0= -tinygo.org/x/tinyfont v0.4.1-0.20241022105211-0b3702cd6364/go.mod h1:7nVj3j3geqBoPDzpFukAhF1C8AP9YocMsZy0HSAcGCA= +tinygo.org/x/tinyfont v0.6.0 h1:GibXDSFz6xrWnEDkDRo6vsbOyRw0MVj/eza3zNHMSHs= +tinygo.org/x/tinyfont v0.6.0/go.mod h1:onflMSkpWl7r7j4MIqhPEVV39pn7yL4N3MOePl3G+G8= From 4f963ca378b920d3b8b17e75d61e3a94f817b842 Mon Sep 17 00:00:00 2001 From: sago35 Date: Fri, 30 Jan 2026 09:41:06 +0900 Subject: [PATCH 2/3] Update Go and TinyGo --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 345fdc8..faebcbf 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ TinyGo は基本的に最新および直前 Version の Go と組み合わせて | TinyGo | 対応する Go | | ------ | ----------- | +| 0.40.1 | 1.25 - 1.24 | | 0.39.0 | 1.25 - 1.24 | -| 0.38.0 | 1.24 - 1.23 | それぞれの実行体に PATH が通っていれば使うことができます。 少し Version が古いですが以下も参考になると思います。 @@ -48,19 +48,19 @@ TinyGo は基本的に最新および直前 Version の Go と組み合わせて ``` $ tinygo version -tinygo version 0.39.0 windows/amd64 (using go version go1.25.0 and LLVM version 19.1.2) +tinygo version 0.40.1 windows/amd64 (using go version go1.25.6 and LLVM version 20.1.1) ``` ``` $ tinygo build -o out.uf2 --target waveshare-rp2040-zero --size short examples/serial code data bss | flash ram - 9824 108 5240 | 9932 5348 + 9720 108 5208 | 9828 5316 ``` ``` $ tinygo flash --target waveshare-rp2040-zero --size short examples/serial code data bss | flash ram - 9824 108 5240 | 9932 5348 + 9720 108 5208 | 9828 5316 $ tinygo monitor --target waveshare-rp2040-zero Connected to COM12. Press Ctrl-C to exit. From bd35b7a4150099acfadbb14621a2a873f10dd718 Mon Sep 17 00:00:00 2001 From: sago35 Date: Fri, 30 Jan 2026 10:25:36 +0900 Subject: [PATCH 3/3] Fix: ssd1306 --- 08_oled_tinydraw/main.go | 6 ++-- 09_oled_tinyfont/main.go | 4 +-- 10_oled_rotated/main.go | 2 +- 11_oled_animation/main.go | 2 +- 16_oled_inverted_hw/main.go | 4 +-- 17_oled_japanese_font/main.go | 4 +-- 19_redkey/main.go | 2 +- 20_rotary_gopher/main.go | 8 ++--- 21_midi2/main.go | 56 +++++++++++++++++------------------ 23_akatonbo/display.go | 3 +- 24_sht40/main.go | 4 +-- 80_checker/main.go | 42 +++++++++++++------------- 12 files changed, 69 insertions(+), 68 deletions(-) diff --git a/08_oled_tinydraw/main.go b/08_oled_tinydraw/main.go index 7bb2959..5c4be67 100644 --- a/08_oled_tinydraw/main.go +++ b/08_oled_tinydraw/main.go @@ -28,15 +28,15 @@ func main() { white := color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF} for { - tinydraw.Rectangle(&display, 10, 20, 30, 40, white) + tinydraw.Rectangle(display, 10, 20, 30, 40, white) display.Display() time.Sleep(500 * time.Millisecond) - tinydraw.FilledCircle(&display, 60, 50, 10, white) + tinydraw.FilledCircle(display, 60, 50, 10, white) display.Display() time.Sleep(500 * time.Millisecond) - tinydraw.Triangle(&display, 100, 10, 80, 40, 60, 10, white) + tinydraw.Triangle(display, 100, 10, 80, 40, 60, 10, white) display.Display() time.Sleep(500 * time.Millisecond) diff --git a/09_oled_tinyfont/main.go b/09_oled_tinyfont/main.go index d691a5d..8a8d15a 100644 --- a/09_oled_tinyfont/main.go +++ b/09_oled_tinyfont/main.go @@ -29,7 +29,7 @@ func main() { white := color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF} - tinyfont.WriteLine(&display, &freemono.Bold9pt7b, 5, 10, "hello", white) - tinyfont.WriteLine(&display, &gophers.Regular32pt, 5, 50, "ABCEF", white) + tinyfont.WriteLine(display, &freemono.Bold9pt7b, 5, 10, "hello", white) + tinyfont.WriteLine(display, &gophers.Regular32pt, 5, 50, "ABCEF", white) display.Display() } diff --git a/10_oled_rotated/main.go b/10_oled_rotated/main.go index 8ea52f6..0062d8e 100644 --- a/10_oled_rotated/main.go +++ b/10_oled_rotated/main.go @@ -28,7 +28,7 @@ func main() { display.ClearDisplay() time.Sleep(50 * time.Millisecond) - rotDisplay := RotatedDisplay{&display} + rotDisplay := RotatedDisplay{display} white := color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF} diff --git a/11_oled_animation/main.go b/11_oled_animation/main.go index d47a826..88485d0 100644 --- a/11_oled_animation/main.go +++ b/11_oled_animation/main.go @@ -34,7 +34,7 @@ func main() { for { display.ClearBuffer() data[0], data[1], data[2], data[3], data[4] = data[1], data[2], data[3], data[4], data[0] - tinyfont.WriteLine(&display, &gophers.Regular32pt, 5, 45, string(data), white) + tinyfont.WriteLine(display, &gophers.Regular32pt, 5, 45, string(data), white) display.Display() time.Sleep(200 * time.Millisecond) } diff --git a/16_oled_inverted_hw/main.go b/16_oled_inverted_hw/main.go index 316ad41..510aafc 100644 --- a/16_oled_inverted_hw/main.go +++ b/16_oled_inverted_hw/main.go @@ -32,7 +32,7 @@ func main() { white := color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF} - tinyfont.WriteLine(&display, &freemono.Bold9pt7b, 5, 10, "hello", white) - tinyfont.WriteLine(&display, &gophers.Regular32pt, 5, 50, "ABCEF", white) + tinyfont.WriteLine(display, &freemono.Bold9pt7b, 5, 10, "hello", white) + tinyfont.WriteLine(display, &gophers.Regular32pt, 5, 50, "ABCEF", white) display.Display() } diff --git a/17_oled_japanese_font/main.go b/17_oled_japanese_font/main.go index d57a1fb..649685e 100644 --- a/17_oled_japanese_font/main.go +++ b/17_oled_japanese_font/main.go @@ -32,7 +32,7 @@ func main() { white := color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF} - tinyfont.WriteLine(&display, &shnm.Shnmk12, 5, 10, "こんにちは世界", white) - tinyfont.WriteLine(&display, &gophers.Regular32pt, 5, 50, "ABCEF", white) + tinyfont.WriteLine(display, &shnm.Shnmk12, 5, 10, "こんにちは世界", white) + tinyfont.WriteLine(display, &gophers.Regular32pt, 5, 50, "ABCEF", white) display.Display() } diff --git a/19_redkey/main.go b/19_redkey/main.go index eaeb8f7..813d1b0 100644 --- a/19_redkey/main.go +++ b/19_redkey/main.go @@ -180,7 +180,7 @@ func main() { display.SetRotation(drivers.Rotation180) // ディスプレイ状態管理の初期化 - ポインタとして渡す - displayState := NewDisplayState(&display) + displayState := NewDisplayState(display) // キーマトリックスピン設定 colPins := []machine.Pin{ diff --git a/20_rotary_gopher/main.go b/20_rotary_gopher/main.go index 4c40392..a46a229 100644 --- a/20_rotary_gopher/main.go +++ b/20_rotary_gopher/main.go @@ -40,7 +40,7 @@ func main() { time.Sleep(50 * time.Millisecond) white := color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF} - tinyfont.WriteLine(&display, &gophers.Regular32pt, 0, 50, alphabet, white) + tinyfont.WriteLine(display, &gophers.Regular32pt, 0, 50, alphabet, white) display.Display() oldValue := int16(0) @@ -51,9 +51,9 @@ func main() { println("value: ", newValue) - tinyfont.WriteLine(&display, &gophers.Regular32pt, oldValue-alphabetWidth, 50, alphabet, white) - tinyfont.WriteLine(&display, &gophers.Regular32pt, oldValue, 50, alphabet, white) - tinyfont.WriteLine(&display, &gophers.Regular32pt, oldValue+alphabetWidth, 50, alphabet, white) + tinyfont.WriteLine(display, &gophers.Regular32pt, oldValue-alphabetWidth, 50, alphabet, white) + tinyfont.WriteLine(display, &gophers.Regular32pt, oldValue, 50, alphabet, white) + tinyfont.WriteLine(display, &gophers.Regular32pt, oldValue+alphabetWidth, 50, alphabet, white) display.Display() } time.Sleep(10 * time.Millisecond) diff --git a/21_midi2/main.go b/21_midi2/main.go index 3a2cccf..f7a5d1f 100644 --- a/21_midi2/main.go +++ b/21_midi2/main.go @@ -67,7 +67,7 @@ const ( var ( displayWhite = color.RGBA{R: 0xFF, G: 0xFF, B: 0xFF, A: 0xFF} displayBlack = color.RGBA{R: 0x00, G: 0x00, B: 0x00, A: 0xFF} - display ssd1306.Device + display *ssd1306.Device ) // Not番号から音名のマッピング @@ -693,12 +693,12 @@ func redraw(state State) { if state.DrumPatternIndex >= 0 && state.DrumPatternIndex < len(drumPatterns) { patternName = drumPatterns[state.DrumPatternIndex].Name } - tinyfont.WriteLine(&display, &shnm.Shnmk12, 5, 12, patternName, displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, 5, 12, patternName, displayWhite) if state.DrumPlaying { - tinyfont.WriteLine(&display, &shnm.Shnmk12, 5, 24, "State: Playing", displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, 5, 24, "State: Playing", displayWhite) } else { - tinyfont.WriteLine(&display, &shnm.Shnmk12, 5, 24, "State: Pausing", displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, 5, 24, "State: Pausing", displayWhite) } // キーボード表示 @@ -708,63 +708,63 @@ func redraw(state State) { fontKeyNameY := (sz+2)*(3+0) + sz + 8 // 1行目のキー - Rectangle(state.Keys[0], &display, x+(sz+2)*0, (sz+2)*(3+0), sz, sz, displayWhite) - Rectangle(state.Keys[3], &display, x+(sz+2)*1, (sz+2)*(3+0), sz, sz, displayWhite) - Rectangle(state.Keys[6], &display, x+(sz+2)*2, (sz+2)*(3+0), sz, sz, displayWhite) - Rectangle(state.Keys[9], &display, x+(sz+2)*3, (sz+2)*(3+0), sz, sz, displayWhite) + Rectangle(state.Keys[0], display, x+(sz+2)*0, (sz+2)*(3+0), sz, sz, displayWhite) + Rectangle(state.Keys[3], display, x+(sz+2)*1, (sz+2)*(3+0), sz, sz, displayWhite) + Rectangle(state.Keys[6], display, x+(sz+2)*2, (sz+2)*(3+0), sz, sz, displayWhite) + Rectangle(state.Keys[9], display, x+(sz+2)*3, (sz+2)*(3+0), sz, sz, displayWhite) // 音名表示 if state.ActiveNotes[0] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[0], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[0], displayWhite) } if state.ActiveNotes[3] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[3], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[3], displayWhite) } if state.ActiveNotes[6] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[6], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[6], displayWhite) } if state.ActiveNotes[9] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[9], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[9], displayWhite) } // 2行目のキー - Rectangle(state.Keys[1], &display, x+(sz+2)*0, (sz+2)*(3+1), sz, sz, displayWhite) - Rectangle(state.Keys[4], &display, x+(sz+2)*1, (sz+2)*(3+1), sz, sz, displayWhite) - Rectangle(state.Keys[7], &display, x+(sz+2)*2, (sz+2)*(3+1), sz, sz, displayWhite) - Rectangle(state.Keys[10], &display, x+(sz+2)*3, (sz+2)*(3+1), sz, sz, displayWhite) + Rectangle(state.Keys[1], display, x+(sz+2)*0, (sz+2)*(3+1), sz, sz, displayWhite) + Rectangle(state.Keys[4], display, x+(sz+2)*1, (sz+2)*(3+1), sz, sz, displayWhite) + Rectangle(state.Keys[7], display, x+(sz+2)*2, (sz+2)*(3+1), sz, sz, displayWhite) + Rectangle(state.Keys[10], display, x+(sz+2)*3, (sz+2)*(3+1), sz, sz, displayWhite) // 音名表示 if state.ActiveNotes[1] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[1], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[1], displayWhite) } if state.ActiveNotes[4] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[4], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[4], displayWhite) } if state.ActiveNotes[7] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[7], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[7], displayWhite) } if state.ActiveNotes[10] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[10], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[10], displayWhite) } // 3行目のキー - Rectangle(state.Keys[2], &display, x+(sz+2)*0, (sz+2)*(3+2), sz, sz, displayWhite) - Rectangle(state.Keys[5], &display, x+(sz+2)*1, (sz+2)*(3+2), sz, sz, displayWhite) - Rectangle(state.Keys[8], &display, x+(sz+2)*2, (sz+2)*(3+2), sz, sz, displayWhite) - Rectangle(state.Keys[11], &display, x+(sz+2)*3, (sz+2)*(3+2), sz, sz, displayWhite) + Rectangle(state.Keys[2], display, x+(sz+2)*0, (sz+2)*(3+2), sz, sz, displayWhite) + Rectangle(state.Keys[5], display, x+(sz+2)*1, (sz+2)*(3+2), sz, sz, displayWhite) + Rectangle(state.Keys[8], display, x+(sz+2)*2, (sz+2)*(3+2), sz, sz, displayWhite) + Rectangle(state.Keys[11], display, x+(sz+2)*3, (sz+2)*(3+2), sz, sz, displayWhite) // 音名表示 if state.ActiveNotes[2] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[2], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[2], displayWhite) } if state.ActiveNotes[5] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[5], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[5], displayWhite) } if state.ActiveNotes[8] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[8], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[8], displayWhite) } if state.ActiveNotes[11] != "" { - tinyfont.WriteLine(&display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[11], displayWhite) + tinyfont.WriteLine(display, &shnm.Shnmk12, fontKeyNameX, fontKeyNameY, state.ActiveNotes[11], displayWhite) } display.Display() diff --git a/23_akatonbo/display.go b/23_akatonbo/display.go index 84f6e5b..6b85e83 100644 --- a/23_akatonbo/display.go +++ b/23_akatonbo/display.go @@ -5,6 +5,7 @@ import ( "image/color" "machine" "time" + "tinygo.org/x/drivers" "tinygo.org/x/drivers/ssd1306" "tinygo.org/x/tinyfont" @@ -53,7 +54,7 @@ func InitDisplay() *Display { time.Sleep(50 * time.Millisecond) return &Display{ - device: &device, + device: device, currentLine: 0, lines: [MAX_SCROLL_LINES]string{}, // 空文字列で初期化 } diff --git a/24_sht40/main.go b/24_sht40/main.go index b928b9d..92708df 100644 --- a/24_sht40/main.go +++ b/24_sht40/main.go @@ -45,8 +45,8 @@ func main() { h := fmt.Sprintf("湿度 %.2f %", float32(humidity)/1000) display.ClearBuffer() - tinyfont.WriteLine(&display, &shnm.Shnmk12, 5, 10, t, white) - tinyfont.WriteLine(&display, &shnm.Shnmk12, 5, 30, h, white) + tinyfont.WriteLine(display, &shnm.Shnmk12, 5, 10, t, white) + tinyfont.WriteLine(display, &shnm.Shnmk12, 5, 30, h, white) display.Display() time.Sleep(1 * time.Second) } diff --git a/80_checker/main.go b/80_checker/main.go index 5e7ff82..04b1704 100644 --- a/80_checker/main.go +++ b/80_checker/main.go @@ -270,41 +270,41 @@ type State struct { Keys [12]bool } -func redraw(d ssd1306.Device, state State) { +func redraw(d *ssd1306.Device, state State) { d.ClearBuffer() sz := int16(8) // joystick - Rectangle(state.Up, &d, (sz+2)*1, (sz+2)*0, sz, sz, white) - Rectangle(state.Left, &d, (sz+2)*0, (sz+2)*1, sz, sz, white) - Rectangle(state.Right, &d, (sz+2)*2, (sz+2)*1, sz, sz, white) - Rectangle(state.Down, &d, (sz+2)*1, (sz+2)*2, sz, sz, white) - Rectangle(state.Center, &d, (sz+2)*1, (sz+2)*1, sz, sz, white) + Rectangle(state.Up, d, (sz+2)*1, (sz+2)*0, sz, sz, white) + Rectangle(state.Left, d, (sz+2)*0, (sz+2)*1, sz, sz, white) + Rectangle(state.Right, d, (sz+2)*2, (sz+2)*1, sz, sz, white) + Rectangle(state.Down, d, (sz+2)*1, (sz+2)*2, sz, sz, white) + Rectangle(state.Center, d, (sz+2)*1, (sz+2)*1, sz, sz, white) // rotary encoder x := 128 - sz*3 - Triangle(state.RotaryLeft, &d, x-sz, sz*2+sz/2, x-sz, sz*2-sz/2, x-2*sz, sz*2, white) - Circle(state.RotaryButton, &d, x, sz*2, sz-2, white) - Triangle(state.RotaryRight, &d, x+sz, sz*2+sz/2, x+sz, sz*2-sz/2, x+2*sz, sz*2, white) + Triangle(state.RotaryLeft, d, x-sz, sz*2+sz/2, x-sz, sz*2-sz/2, x-2*sz, sz*2, white) + Circle(state.RotaryButton, d, x, sz*2, sz-2, white) + Triangle(state.RotaryRight, d, x+sz, sz*2+sz/2, x+sz, sz*2-sz/2, x+2*sz, sz*2, white) // Keys x = 128/2 - (sz+2)*2 - Rectangle(state.Keys[0], &d, x+(sz+2)*0, (sz+2)*(3+0), sz, sz, white) - Rectangle(state.Keys[1], &d, x+(sz+2)*0, (sz+2)*(3+1), sz, sz, white) - Rectangle(state.Keys[2], &d, x+(sz+2)*0, (sz+2)*(3+2), sz, sz, white) + Rectangle(state.Keys[0], d, x+(sz+2)*0, (sz+2)*(3+0), sz, sz, white) + Rectangle(state.Keys[1], d, x+(sz+2)*0, (sz+2)*(3+1), sz, sz, white) + Rectangle(state.Keys[2], d, x+(sz+2)*0, (sz+2)*(3+2), sz, sz, white) - Rectangle(state.Keys[3], &d, x+(sz+2)*1, (sz+2)*(3+0), sz, sz, white) - Rectangle(state.Keys[4], &d, x+(sz+2)*1, (sz+2)*(3+1), sz, sz, white) - Rectangle(state.Keys[5], &d, x+(sz+2)*1, (sz+2)*(3+2), sz, sz, white) + Rectangle(state.Keys[3], d, x+(sz+2)*1, (sz+2)*(3+0), sz, sz, white) + Rectangle(state.Keys[4], d, x+(sz+2)*1, (sz+2)*(3+1), sz, sz, white) + Rectangle(state.Keys[5], d, x+(sz+2)*1, (sz+2)*(3+2), sz, sz, white) - Rectangle(state.Keys[6], &d, x+(sz+2)*2, (sz+2)*(3+0), sz, sz, white) - Rectangle(state.Keys[7], &d, x+(sz+2)*2, (sz+2)*(3+1), sz, sz, white) - Rectangle(state.Keys[8], &d, x+(sz+2)*2, (sz+2)*(3+2), sz, sz, white) + Rectangle(state.Keys[6], d, x+(sz+2)*2, (sz+2)*(3+0), sz, sz, white) + Rectangle(state.Keys[7], d, x+(sz+2)*2, (sz+2)*(3+1), sz, sz, white) + Rectangle(state.Keys[8], d, x+(sz+2)*2, (sz+2)*(3+2), sz, sz, white) - Rectangle(state.Keys[9], &d, x+(sz+2)*3, (sz+2)*(3+0), sz, sz, white) - Rectangle(state.Keys[10], &d, x+(sz+2)*3, (sz+2)*(3+1), sz, sz, white) - Rectangle(state.Keys[11], &d, x+(sz+2)*3, (sz+2)*(3+2), sz, sz, white) + Rectangle(state.Keys[9], d, x+(sz+2)*3, (sz+2)*(3+0), sz, sz, white) + Rectangle(state.Keys[10], d, x+(sz+2)*3, (sz+2)*(3+1), sz, sz, white) + Rectangle(state.Keys[11], d, x+(sz+2)*3, (sz+2)*(3+2), sz, sz, white) d.Display() }