summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--tests/pyb/can.py9
-rw-r--r--tests/pyb/can.py.exp4
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/pyb/can.py b/tests/pyb/can.py
new file mode 100644
index 0000000000..e116955682
--- /dev/null
+++ b/tests/pyb/can.py
@@ -0,0 +1,9 @@
+from pyb import CAN
+
+can = CAN(1)
+print(can)
+can.init(CAN.LOOPBACK)
+print(can.any(0))
+can.send('abcd', 123)
+print(can.any(0))
+print(can.recv(0))
diff --git a/tests/pyb/can.py.exp b/tests/pyb/can.py.exp
new file mode 100644
index 0000000000..e5c420dd06
--- /dev/null
+++ b/tests/pyb/can.py.exp
@@ -0,0 +1,4 @@
+CAN(1)
+False
+True
+(123, 0, 0, b'abcd')