...
Code Block | ||
---|---|---|
| ||
def writeString(offset, myString): f=open("/dev/piControl0","wb+",0) f.seek(offset) f.write(str.encode(myString)) def readString(offset, length): f=open("/dev/piControl0","wb+",0) f.seek(offset) my_string_as_bytes = f.read(length) return my_string_as_bytes.decode() writeString(4843,'Hello World') readString(4843,11) ' Hello World |
Verify
...
the contents of the process image with piTest
Code Block | ||
---|---|---|
| ||
pi@RevPi40302:~ $ piTest -1 -r 4843,11 72 101 108 108 111 32 87 111 114 108 100 pi@RevPi40302:~ $ piTest -1 -r 43,11,h 48 65 6c 6c 6f 20 57 6f 72 6c 64 |
RevPiModIO
Library developed from the RevPi community
Allows easy use of symbolic names from PiCtory
Installation not necessary already on the device
Documentation
...