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); } }