Proximity sensor using VL53L0x

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Maser
Posts: 2
Joined: Wed Mar 18, 2020 4:28 pm

Proximity sensor using VL53L0x

Post by Maser » Wed Mar 18, 2020 4:53 pm

Hello

I am trying to use the VL53L0x and a Trinket M0 to sense the presens of a person.

I have got it to work meassureing distance with the given CircuitPhyton code:

import board
import busio
import adafruit_vl53l0x

i2c = busio.I2C(board.SCL, board.SDA)
vl53 = adafruit_vl53l0x.VL53L0X(i2c)
vl53.measurement_timing_budget = 20000

while True:
print('Avstand: {0} mm'.format(vl53.range))
time.sleep(1.0)

But rather than meassuring distance I would like it to give a signal on any of the io pins of the Trinket (to drive a relay or a transistor).
I have spent the day looking for such a code with limited sucsess.
Can anybody help :?:

Regards Jan S

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Proximity sensor using VL53L0x

Post by Roberthh » Wed Mar 18, 2020 5:02 pm

It looks like the wrong place to ask. Better ask at the adafruit forum: https://forums.adafruit.com/

Maser
Posts: 2
Joined: Wed Mar 18, 2020 4:28 pm

Re: Proximity sensor using VL53L0x

Post by Maser » Thu Mar 19, 2020 7:01 am

Thanks :D

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Proximity sensor using VL53L0x

Post by devnull » Sat Mar 28, 2020 3:56 am

Did you do a search ??

search.php?keywords=VL53L0x

There's already quite a lot about this device in these forums :D

Post Reply