-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
import "@dsboard/seeed_xiao_esp32c3" | ||
import * as ds from "@devicescript/core" | ||
import { | ||
XiaoGroveShield, | ||
startGroveRGBLCD16x2, | ||
startBME680, | ||
XiaoGroveShield, | ||
} from "@devicescript/drivers" | ||
import { ValueDashboard } from "@devicescript/runtime" | ||
|
||
const shield = new XiaoGroveShield() | ||
const { temperature, humidity } = await startBME680({ | ||
address: 0x76, | ||
}) | ||
const screen = await startGroveRGBLCD16x2() | ||
|
||
const board = new XiaoGroveShield() | ||
const dashboard = new ValueDashboard(screen, { | ||
temp: { digits: 1, unit: "C" }, | ||
humi: { digits: 0, unit: "%" }, | ||
}) | ||
|
||
const { temperature } = await startBME680() | ||
const lcd = await startGroveRGBLCD16x2() | ||
setInterval(async () => { | ||
const temp = Math.round(await temperature.reading.read()) | ||
await lcd.message.write(`temp: ${temp}C`) | ||
dashboard.values.temp = await temperature.reading.read() | ||
dashboard.values.humi = await humidity.reading.read() | ||
await dashboard.show() | ||
}, 1000) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.