machine.I2C

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
User avatar
deshipu
Posts: 1353
Joined: Thu May 28, 2015 5:54 pm

Re: machine.I2C

Post by deshipu » Sun Jul 02, 2017 9:34 am

That looks like your vl53L0x.py file didn't get uploaded properly to the board. Can you verify it's there and has the correct contents?

kpg
Posts: 6
Joined: Tue Jun 27, 2017 3:31 pm

Re: machine.I2C

Post by kpg » Mon Jul 03, 2017 7:45 pm

Yes you right,
One of the problem was the firmware because after put firmware in ESP8266 and tried to connect by putty the command prompt doesn´t respond.

other problem was that i was using ESPlorer v0.2.0-rc5 to save script, and when i tried to save file in vl53l0x, just create the file but empty(syntax error, memory failed, etc).
The solution for my case was use pip install adafruit-ampy to save vl53l0x.py into esp8266.
Now i am getting this:

=== from machine import I2C, Pin
=== import vl53l0x
===
=== i2c = I2C(-1, Pin(5), Pin(4))
=== sensor = vl53l0x.VL53L0X(i2c)
===
=== distance = sensor.read()
=== print(distance)
===
68
>>>

This value is in mm?

User avatar
deshipu
Posts: 1353
Joined: Thu May 28, 2015 5:54 pm

Re: machine.I2C

Post by deshipu » Mon Jul 03, 2017 8:16 pm

Yes, the value should be in mm.

kpg
Posts: 6
Joined: Tue Jun 27, 2017 3:31 pm

Re: machine.I2C

Post by kpg » Thu Jul 20, 2017 3:58 pm

Hi guys, somebody know how can i change the i2C address of VL53L0X, using micropython? my idea is use multiple sensor with esp8266.

User avatar
deshipu
Posts: 1353
Joined: Thu May 28, 2015 5:54 pm

Re: machine.I2C

Post by deshipu » Thu Jul 20, 2017 5:57 pm

kpg wrote:Hi guys, somebody know how can i change the i2C address of VL53L0X, using micropython? my idea is use multiple sensor with esp8266.
ST has an application note on the subject: http://www.st.com/content/ccc/resource/ ... 280486.pdf

In short, you can't without additional hardware.

But since the i2c is software on the esp8266, you can have several i2c buses on different pins (I think you could even share one of the lines).

BOB63
Posts: 57
Joined: Sat Jul 25, 2015 8:24 pm
Location: Monza , Italy

Re: machine.I2C

Post by BOB63 » Fri Mar 02, 2018 8:28 pm

Hi ,
I'm interested to the vl53l0x library .
Please ,where can I find it?
Thanks Roberto.
Thanks. Roberto

BOB63
Posts: 57
Joined: Sat Jul 25, 2015 8:24 pm
Location: Monza , Italy

Re: machine.I2C

Post by BOB63 » Sat Mar 03, 2018 11:27 am

At the end I've found it !
Thanks. Roberto

Post Reply