Hi, I am experimenting with Nicla Vision’s LSM6DSOXTR 6-axis IMU and VL53L1CBV0FY/1 Time-of-Flight Sensor (really cool!). Drawing parallel to another project of mine on Portenta, I wanted to see if it’s possible to wake up Nicla from deepsleep based on either IMU reading on movement intensity or distance from the ToF sensor.
I thought I’d have to code a wrapper function to convert these continuous variables into HIGH and LOW but also came across IRQ_LOW_LEVEL
and IRQ_HIGH_LEVEL
(ref here) that intuitively seems could help my case. I tested on the following dummy program (on a GPIO pin itself) and got AttributeError: type object 'Pin' has no attribute 'IRQ_HIGH_LEVEL'
from machine import Pin, deepsleep
from pyb import ExtInt, LED, delay
def callback(line):
pass
pin = Pin("PG12", Pin.IN, Pin.PULL_UP)
ext = ExtInt(pin, Pin.IRQ_HIGH_LEVEL, Pin.PULL_UP, callback)
deepsleep()
while True:
pyb.LED(1).on()
pyb.delay(100)
pyb.LED(1).off()
pyb.delay(100)
Are IRQ_HIGH_LEVEL
and IRQ_LOW_LEVEL
not supported?
PC