Project 10: R1BBIT MINI + VL53 A simple ruler

A simple ruler with VL53. No Wi-Fi, only Direct USB

VAR DIST_SM, DIST_INCH // DIST_SM: raw distance in millimeters
 // DIST_INCH: converted distance in inches

VL53_INIT(DIST_SM, 500) // Initialize VL53 sensor
 // DIST will update with a new measurement every 500 ms

PAUSE 1000 // Wait for the first valid sensor reading

WHILE(1) // Continuous measurement loop
 DIST_INCH = (DIST_SM - 81) / 25.4 // Convert mm to inches (minus offset)
 
 PRINT DIST_INCH, // Print distance in inches 
 
 PAUSE 100 // Wait 100 ms before printing again
WEND // End of loop
×
100%