Thank you for replying zach!
so you mean I’m receiving a ascii text of my distance value?
how can I construct a string out of the ascii text(byte) into original integer data?
sorry for keep asking I’m currently learning OF
the arduino serial monitor has mm(millimeter) value which is like below
and the OF
it seems to have a same value, I’ve checked by moving my hand.
but the value crashs after 999 (which is the begin of 4 digits), I think it just prints out first 2digit only if the value is 4 digits long.
both baud rate is set to 115200
my code of arduino
This example takes range measurements with the VL53L1X and displays additional
details (status and signal/ambient rates) for each measurement, which can help
you determine whether the sensor is operating normally and the reported range is
valid. The range is in units of mm, and the rates are in units of MCPS (mega
counts per second).
int data = 0;
Wire.setClock(400000); // use 400 kHz I2C
Serial.println("Failed to detect and initialize sensor!");
// Use long distance mode and allow up to 50000 us (50 ms) for a measurement.
// You can change these settings to adjust the performance of the sensor, but
// the minimum timing budget is 20 ms for short distance mode and 33 ms for
// medium and long distance modes. See the VL53L1X datasheet for more
// information on range and timing limits.
// Start continuous readings at a rate of one measurement every 50 ms (the
// inter-measurement period). This period should be at least as long as the
// timing budget.
data = sensor.ranging_data.range_mm;
// Serial.print("range: ");
// Serial.print("\tstatus: ");
// Serial.print("\tpeak signal: ");
// Serial.print("\tambient: ");