Weitere Vorbereitungen

This commit is contained in:
2020-09-11 14:59:32 +02:00
parent 5d61a92fce
commit bd306cf32f
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python
import os
def sb_write(fd, servo, pulse):
try:
os.write(fd, '%d=%d\n' % (servo,pulse))
except IOError as e:
print e
try:
fd = os.open('/dev/servoblaster', os.O_WRONLY)
except OSError as e:
print 'could not open /dev/servoblaster'
raise SystemExit(5)
except (KeyboardInterrupt, SystemExit):
os.close(fd)
pass