We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8205da9 commit 4f18da3Copy full SHA for 4f18da3
generate/templates/device.py.in
@@ -50,6 +50,10 @@ class PingDevice(object):
50
# write_timeout fixes it getting stuck forever atempting to write to
51
# /dev/ttyAMA0 on Raspberry Pis, this raises an exception instead.
52
self.iodev = serial.Serial(device_name, baudrate, write_timeout=1.0)
53
+ try:
54
+ self.iodev.set_low_latency_mode(True)
55
+ except Exception as exception:
56
+ print("Failed to set low latency mode: {0}".format(exception))
57
self.iodev.send_break()
58
time.sleep(0.001)
59
self.iodev.write("U".encode("ascii"))
0 commit comments