It must connected using I2C using the wiring as shown below :
To start to use, it must be initialised using the VL53L0X.INIT function.
The syntax is:
Ret = VL53L0X.INIT
It returns 1 if the initialisation was successful or 0 if not OK.
Then, the following commands are available :
VL53L0X.SETRANGE range
Set the distance range (sensitivity); by default the value is 0 for a max range of 600 mm
VL53L0X.SETACCURACY accuracy
Set the accuracy of the readout modifying the time required for the measurement.
By default the value is 0 for a Measurement time of 33 msec.
Finally it is possible to read the distance using the function
Dist = VL53L0X.DISTANCE
The value returned is the distance measured in millimeters.
If the measurement is not valid, for example if the distance is out of range, this function returns 8190.
This is a “blocking” function meaning that the program will stop the time required for the measurement, i.e. 400 ms when using the accuracy at 2.
For this reason the function VL53L0X.DISTANCE_N returns the same information but without blocking the execution of the code.
Obviously, the distance measured will be “refreshed” only at the rate defined with the function VL53L0X.SETACCURACY
Example:
Display a BMP or JPG file on the TFT display.
The file format must be ".bmp" with 24 or 32 bits or “.jpg”
(followed by)
‘filename$’ is the name of the bmp file
Display a JPG file on the TFT display.
The file format must be “.jpg”
(but later)
‘filename$’ is the name of the bmp file
Display a BMP or JPG file on the TFT display.
The file format must be ".bmp" with 24 or 32 bits or “.jpg”
(followed by)
‘filename$’ is the name of the image file
Display a JPG file on the TFT display.
The file format must be “.jpg”
(but later)
‘filename$’ is the name of the jpg file
AudioFileSourceFile REOPEN 0 50700 162AudioFileSourceFile read 0 avail 162 pos 50700
Hmm - almost got it - but with an imagebutton (toggle style) the image changes but the event is only called at one of the changes.
Gui.setevent object, event_type, label | OFF
Define an event for any object.
Event | Meaning |
0 (NONE) | Disable the event |
1 (CLICK) | Triggered when touching on the object |
2 (LEAVE) | Triggered when leaving the touch from the object |
3 (CHANGE) | Triggered when the value of the object change |
Label is the place where it will jump. OFF disable the event.
The events can be defined for button, checkbox, slider, image and imagebutton.
I have an M5stack and have tried using arduino and micropython environments to do something as simple as an https request. Time to give Annex32 a shot. Any advice for use with the M5? LCD and buttons working?
So I tried to integrate the MicroSD-board in the NodeMCU in a way that it needs no additional space on the breadboard. The PCB now sits unter the NodeMCU-board and the board pins still have very good contact to the breadboard.I reduced the height of the yellow spacers with sandpaper (original board at the top).
Made necessary distance for the Micro-SD board.
Replaced the Pins by vero-wires, added a 10k pullup-resistor on CS and
isolated the solder pads on the backside with double-sided adhesive tape
I placed the board under the spacers
and threaded the wires through the rows of pins to the upside where i soldered them to the top of the pins.
The MicroSD-Card sits now under the MicroUSB-connector.
The card can easily be changed.
The combination needs no additional space on the (test) board.
Thanks,but I made a wiring mistake with VCC of the MicroSD-Modul that is not 3V3 but 5V.