From 9328aee134398f12f17117acc5628b2fc3882cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Bo=C4=8Dek?= Date: Wed, 10 Jul 2024 20:51:13 +0200 Subject: [PATCH] fix: dalkomer example --- docs/robot/vl53/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/robot/vl53/index.md b/docs/robot/vl53/index.md index cafa949c..c80791d5 100644 --- a/docs/robot/vl53/index.md +++ b/docs/robot/vl53/index.md @@ -40,15 +40,15 @@ Nyní si ukážeme, jak můžeme měřit vzdálenost pomocí dálkoměru VL53L0X ```ts import { I2C1 } from "i2c"; -import { connect } from "./VL53L0X.js"; +import { VL53L0X } from "./libs/VL53L0X.js" import { stdout } from "stdio"; I2C1.setup({sda: 17, scl: 9, bitrate: 400000}); -const vl = connect(I2C1); +const vl = new VL53L0X(I2C1); async function main() { while (true) { - const m = await vl.performSingleMeasurement(); + const m = await vl.read(); console.log("Distance: " + m.distance + " mm \tSignal: " + m.signalRate + "\tAmb: " + m.ambientRate + "\tSPAD: " + m.effectiveSpadRtnCount); } }