Skip to content

Commit 904bee3

Browse files
committed
Readme for microPython updating.
1 parent a015a6a commit 904bee3

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,5 +340,48 @@ Plug-in supports code development, its upload to the board and communication wit
340340

341341
## VL6180X Sensor use-case ##
342342

343+
Sensor described in this [section](#vl6180x-sensor-use-case) can be used on boards supporting microPython.
344+
345+
### Prerequisites ###
346+
347+
#### Wiring ####
348+
You need to connect I<sup>2</sup>C interface (SCL & SDA) and power lines on the board with corresponding pins on the sensor.
349+
You need to be aware that **boards can use different GPIOs for I<sup>2</sup>C** purposes. Set of typical pairs is placed
350+
in function `get_i2c()` in file `hal.py`. If your board uses other GPIO pins, you need to add them to the tuple `typical_gpio`.
351+
```Python
352+
def get_i2c():
353+
import machine
354+
typical_gpio = ([22, 23], [5, 4], [22, 21])
355+
...
356+
```
357+
![ESP32](image/ESP32_VL6180X.jpg)
358+
359+
#### How to use ####
360+
1. You need to upload additional library for VL6180X support (it is placed in `micropython` folder):
361+
```commandline
362+
> ampy -pCOMXX put vl6180x_micro.py
363+
```
364+
2. Copy `7_distance_and_light_sensor.py` as `main.py` and upload it into board.
365+
366+
After above operations you can see:
367+
```commandline
368+
> ampy -pCOMXX ls
369+
/LiveObjects
370+
/boot.py
371+
/main.py
372+
/umqttrobust.py
373+
/simple.py
374+
/vl6180x_micro.py
375+
376+
> ampy -pCOMXX ls LiveObjects
377+
/LiveObjects/Connection.py
378+
/LiveObjects/__init__.py
379+
/LiveObjects/hal.py
380+
/LiveObjects/credentials.py
381+
/LiveObjects/services.py
382+
```
383+
3. Connect to device and check if it's working using PuTTY.
384+
385+
343386
## Troubleshooting ##
344387
If you are getting 'MQTT exception: 5' check your api key

image/ESP32_VL6180X.jpg

145 KB
Loading

0 commit comments

Comments
 (0)