Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Commit 8368737

Browse files
committed
updated pico_w samples
1 parent 1a4f93e commit 8368737

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1-
import { pins, board } from "@dsboard/pico_bricks"
1+
import { pins, board } from "@dsboard/pico_w"
22
import { SSD1306Driver } from "@devicescript/drivers"
3+
import { configureHardware } from "@devicescript/servers"
34

4-
const ssd = new SSD1306Driver({ width: 64, height: 48 })
5+
configureHardware({
6+
scanI2C: false,
7+
i2c: {
8+
pinSCL: pins.GP5,
9+
pinSDA: pins.GP4,
10+
kHz: 200,
11+
},
12+
})
13+
14+
const ssd = new SSD1306Driver({ width: 128, height: 64, devAddr: 0x3c })
515
await ssd.init()
616
ssd.image.print("Hello world!", 3, 10)
717
await ssd.show()
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import { pins, board } from "@dsboard/pico_bricks"
1+
import { pins, board } from "@dsboard/pico_w"
22
import { SSD1306Driver, startIndexedScreen } from "@devicescript/drivers"
33
import { delay } from "@devicescript/core"
4+
import { configureHardware } from "@devicescript/servers"
5+
6+
configureHardware({
7+
scanI2C: false,
8+
i2c: {
9+
pinSCL: pins.GP5,
10+
pinSDA: pins.GP4,
11+
kHz: 200,
12+
},
13+
})
414

515
const screen = await startIndexedScreen(
6-
new SSD1306Driver({ width: 128, height: 64 })
16+
new SSD1306Driver({ width: 128, height: 64, devAddr: 0x3c })
717
)
818
const image = screen.image
919
image.fill(0)
@@ -12,6 +22,6 @@ for (let x = 0; x < image.width; x += 2) {
1222
for (let y = 0; y < image.height; y += 2) {
1323
image.set(x, y, 1)
1424
await screen.show()
15-
await delay(10)
25+
await delay(100)
1626
}
1727
}

0 commit comments

Comments
 (0)