I’m currently trying to run the CAN protocol example in OpenMV. However, I get the error “ImportError: cannot import name CAN” when trying to run the script .
I’m using the example code provided in the pyb.CAN documentation:
from pyb import CAN can = CAN(2, CAN.LOOPBACK) can.setfilter(0, CAN.LIST16, 0, (123, 124, 125, 126)) # set a filter to receive messages with id=123, 124, 125 and 126 can.send('message!', 123) # send a message with id 123 can.recv(0) # receive message on FIFO 0
I’m using OpenMV IDE 1.5.2 on Windows 7, 64-bit.
I’m relatively new to python. Is it possible that I’m doing something wrong so that the CAN library is not being imported properly?
Thank you for your time.