tests: Add simple CAN test.

pull/889/head
Damien George 2014-10-02 17:30:28 +01:00
rodzic 3550de4ebe
commit e535a61983
2 zmienionych plików z 13 dodań i 0 usunięć

9
tests/pyb/can.py 100644
Wyświetl plik

@ -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))

Wyświetl plik

@ -0,0 +1,4 @@
CAN(1)
False
True
(123, 0, 0, b'abcd')