From c1e1d5ad3ba85a66e3f52bc3ca1074b837912db8 Mon Sep 17 00:00:00 2001 From: pelikhan Date: Mon, 9 Oct 2023 08:19:54 -0700 Subject: [PATCH] updated samples and servers --- packages/sampleprj/src/maingrovelcd16x2.ts | 15 +++++++++------ vscode/src/server-info.json | 11 ++++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/sampleprj/src/maingrovelcd16x2.ts b/packages/sampleprj/src/maingrovelcd16x2.ts index 68e38dd799..d1386ddd8a 100644 --- a/packages/sampleprj/src/maingrovelcd16x2.ts +++ b/packages/sampleprj/src/maingrovelcd16x2.ts @@ -1,13 +1,16 @@ import "@dsboard/seeed_xiao_esp32c3" import * as ds from "@devicescript/core" -import { XiaoExpansionBoard, startGroveRGBLCD16x2 } from "@devicescript/drivers" +import { + XiaoGroveShield, + startGroveRGBLCD16x2, + startBME680, +} from "@devicescript/drivers" -const board = new XiaoExpansionBoard() +const board = new XiaoGroveShield() -console.log("start...") +const { temperature } = await startBME680() const lcd = await startGroveRGBLCD16x2() setInterval(async () => { - const t = ds.millis() + "" - console.log(t) - await lcd.message.write(t) + const temp = Math.round(await temperature.reading.read()) + await lcd.message.write(`temp: ${temp}C`) }, 1000) diff --git a/vscode/src/server-info.json b/vscode/src/server-info.json index d96c41cbe0..d0429593e3 100644 --- a/vscode/src/server-info.json +++ b/vscode/src/server-info.json @@ -330,13 +330,22 @@ }, { "label": "Seeed Studio XIAO Expansion Board", - "detail": "Drivers for the {@link https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/ | Seeed Studio XIAO Expansion Board } for Raspberry Pi Pico.\r", + "detail": "Drivers for the {@link https://wiki.seeedstudio.com/Seeeduino-XIAO-Expansion-Board/ | Seeed Studio XIAO Expansion Board }.\r", "startName": "XiaoExpansionBoard", "imports": { "XiaoExpansionBoard": "@devicescript/drivers" }, "snippet": "const shield = new XiaoExpansionBoard()\n" }, + { + "label": "Grove Shield for Seeed Studio XIAO", + "detail": "Drivers for the {@link https://www.seeedstudio.com/Grove-Shield-for-Seeeduino-XIAO-p-4621.html | Grove Shield for Seeed Studio XIAO } for Raspberry Pi Pico.\r", + "startName": "XiaoGroveShield", + "imports": { + "XiaoGroveShield": "@devicescript/drivers" + }, + "snippet": "const shield = new XiaoGroveShield()\n" + }, { "label": "WaveShare Pico LCD114 for Raspberry Pi Pico", "detail": "Driver for WaveShare Pico-LCD-1.14 inch.\r",