VL53l5CX Examples don't run as rely on ULAB

I am using a PICO Explorer board and VL53L5CX ToF. As Pimoroni Pico v1.19.9 no longer has ulab, only one of the examples works. Does anyone know of a get around to get the data to display as an image from a list?

ulab is still present in boards that have more than 2MB of flash memory, so you could switch to a Pimoroni Pico LiPo and these examples should still work?

(I think ulab is a huge module which is why we no longer include it in builds for 2MB boards - we were running out of room!).

EDIT: ulab is only currently available in the Pimoroni Pico LiPo builds

Thanks for a fast response - I will order a PICO LIPO next week and have a play.

I bought Motor 2040, Tiny 2040 8MB and VL53L5CX. But the ulab module is missing in pimoroni-tiny2040-…-micropython.uf2!
Could you create the new MicroPython?
Thanks

Sorry for the duff info :( yeah, looking at the cmake files ulab is only currently included in the Pimoroni Pico LiPo builds. I’ve asked our software folks if it’s possible to add it to the Tiny 2040 build.

Hi @Eku - we’ve tweaked the cmake rules and future Tiny 2040 8MB builds should now include ulab. If you don’t wait for a new release you could try this hot-off-the-press build: pimoroni-tiny2040-9f736279df7a0de7f7e284cad155129062e121de-micropython.uf2.zip (463.6 KB)

Hello HEL.

Thanks.

The file “pimoroni-tiny2040-…de-micropython.uf2” fits.

It works with Motor 2040, Tiny 2040 8MB and VL53L5CX.

But…

Is it possible to create the “big” version “pimoroni-tiny2040-8mb…-micropython.uf2” with all modules!

Kind regards

Edward

I think the existing tiny2040 build is for the 8MB version? You can check your available flash space with this code:

import os

f_bsize, f_frsize, f_blocks, f_bfree, _, _, _, _, _, f_namemax = os.statvfs("/")
f_total_size = f_frsize * f_blocks
f_total_free = f_bsize * f_bfree

print(f"Total size: {f_total_size/1048576} MB")
print(f"Total free: {f_total_free/1048576} MB")

Hello HEL.
The VL53L5CX breakout need a module ‘ulab (numpy)’.

from time import sleep
from ulab import numpy
import pimoroni_i2c
import breakout_vl53l5cx
from machine import Pin, UART
from pimoroni import Button
from motor import Motor, pico_motor_shim, motor2040

help(‘modules’)

Kind regards
Eduard

I want to use this module with an Inventor 2040 W. I’m working on a Rover build with two Micro Metal Gear Motors. There is no option to swap out the Pico W. What now?

I believe ulab/numpy is only currently included in the builds for boards with greater than 2MB of flash due to space constraints.

There’s an blog post here about how to use Github actions to compile a custom firmware image that contains the modules you want - you could give that a try? Galactic Unicorns and Custom Pimoroni Pico Firmware | by Iestyn Lloyd | Medium

…or you could try the inventor2040w image we just span up here (you’ll need to be logged into Github to see the download links).

I’ve not tested it exhaustively as I don’t have one of the breakouts to hand, but it seems to flash OK to the board and from ulab import numpy works…

That was quick, and did the trick. Many thanks for the quick reply. =)
The object tracking example is working, and giving back good numbers. Near as I can tell anyway. The motion example worked OK too. =)

1 Like