You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
224fee0e10
Addresses issue #968.
16 lines
240 B
Python
16 lines
240 B
Python
# test hal errors
|
|
|
|
import pyb
|
|
|
|
i2c = pyb.I2C(2, pyb.I2C.MASTER)
|
|
try:
|
|
i2c.recv(1, 1)
|
|
except OSError as e:
|
|
print(repr(e))
|
|
|
|
can = pyb.CAN(1, pyb.CAN.NORMAL)
|
|
try:
|
|
can.send('1', 1, timeout=50)
|
|
except OSError as e:
|
|
print(repr(e))
|