How can I use CAN?
Posted: Thu Feb 12, 2015 9:16 am
I write the codes below in main.py. But there is no data out,when i mesure PB9.How can I do?
from pyb import CAN
can = CAN(1,CAN.NORMAL)
can.setfilter(0, CAN.LIST16, 0, (123, 124, 125, 126)) # set a filter to receive messages with id=123, 124, 125 and 126
while True:
can.send('message!', 123) # send a message with id 123
pyb.delay(1000)
from pyb import CAN
can = CAN(1,CAN.NORMAL)
can.setfilter(0, CAN.LIST16, 0, (123, 124, 125, 126)) # set a filter to receive messages with id=123, 124, 125 and 126
while True:
can.send('message!', 123) # send a message with id 123
pyb.delay(1000)