Rev 2 Mar.18
73
41110485
C
C: RS485 Python Script
For your reference, the contents of the rs485.py script appear below.
#!/usr/bin/env python
import sys
fn = sys.argv[1]
if len(sys.argv) > 2:
value = sys.argv[2]
else:
value = None
ttyFile=open('/dev/ttyHSL0')
if value is None:
sysfsFile = open(fn, 'r')
print sysfsFile.read().strip()
else:
sysfsFile = open(fn, 'w')
sysfsFile.write(value)