Skip to content

Commit

Permalink
fix: dalkomer example
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasssadar committed Jul 10, 2024
1 parent 6075f15 commit 9328aee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/robot/vl53/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 9328aee

Please sign in to comment.