This repository was archived by the owner on Dec 8, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { pins , board } from "@dsboard/pico_bricks "
1+ import { pins , board } from "@dsboard/pico_w "
22import { 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 } )
515await ssd . init ( )
616ssd . image . print ( "Hello world!" , 3 , 10 )
717await ssd . show ( )
Original file line number Diff line number Diff line change 1- import { pins , board } from "@dsboard/pico_bricks "
1+ import { pins , board } from "@dsboard/pico_w "
22import { SSD1306Driver , startIndexedScreen } from "@devicescript/drivers"
33import { 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
515const screen = await startIndexedScreen (
6- new SSD1306Driver ( { width : 128 , height : 64 } )
16+ new SSD1306Driver ( { width : 128 , height : 64 , devAddr : 0x3c } )
717)
818const image = screen . image
919image . 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}
You can’t perform that action at this time.
0 commit comments