diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-02 17:30:28 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-02 17:32:02 +0100 |
commit | e535a61983e46f342cbbf32b300cac6c64d01770 (patch) | |
tree | 0743fb13d10b56eb49e300175cd47b2565c62440 /tests/pyb | |
parent | 3550de4ebeb449e221f2dc900d1937510d67cc95 (diff) | |
download | micropython-e535a61983e46f342cbbf32b300cac6c64d01770.tar.gz micropython-e535a61983e46f342cbbf32b300cac6c64d01770.zip |
tests: Add simple CAN test.
Diffstat (limited to 'tests/pyb')
-rw-r--r-- | tests/pyb/can.py | 9 | ||||
-rw-r--r-- | tests/pyb/can.py.exp | 4 |
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') |