15 lines
350 B
Python
15 lines
350 B
Python
import can
|
|
|
|
|
|
input("startReading")
|
|
|
|
can_interface = "can0" # echten can nutzen
|
|
bus = can.interface.Bus(can_interface, bustype="socketcan")
|
|
message = bus.recv(5.0)
|
|
|
|
if message is None:
|
|
print("Timeout occurred, no message.")
|
|
else:
|
|
print("We got a message hell yeah")
|
|
print("{}".format(message.data)) # hat gesendete data von can benutzen
|