Skip to content

Commit

Permalink
Final touches.
Browse files Browse the repository at this point in the history
  • Loading branch information
slav-at-attachix committed Feb 20, 2020
1 parent 4b60f83 commit 235760c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Gesture_Vl53l10</name>
<name>Distance_Vl53l10</name>
<comment></comment>
<projects>
<project>SmingFramework</project>
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions samples/Distance_Vl53l0x/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Distance measurement with Vl530xl sensor
========================================
This sample demonstrates how to use an inexpensive laser sensor VL53L0X to measure distance via I2C interface.

In addition to the original library a "long range" mode is added to measure distances up to 2 meter.
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ Adafruit_VL53L0X lox = Adafruit_VL53L0X();

Timer loopTimer;

void loop() {
VL53L0X_RangingMeasurementData_t measure;
void loop()
{
VL53L0X_RangingMeasurementData_t measure;

Serial.print("Reading a measurement... ");
lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!
Serial.print("Reading a measurement... ");
lox.rangingTest(&measure, false); // pass in 'true' to get debug data printout!

if (measure.RangeStatus != 4) { // phase failures have incorrect data
Serial.print("Distance (mm): "); Serial.println(measure.RangeMilliMeter);
} else {
Serial.println(" out of range ");
}
if(measure.RangeStatus != 4) { // phase failures have incorrect data
Serial.print("Distance (mm): ");
Serial.println(measure.RangeMilliMeter);
} else {
Serial.println(" out of range ");
}
}

void init()
Expand All @@ -38,9 +40,10 @@ void init()

lox.setLongRangeMode(true);

if (!lox.begin()) {
if(!lox.begin()) {
Serial.println(F("Failed to boot VL53L0X"));
while (1) {}
while(1) {
}
}

Serial.println(F("VL53L0X API Simple Ranging example\n\n"));
Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions samples/Gesture_Vl53l0x/README.rst

This file was deleted.

0 comments on commit 235760c

Please sign in to comment.