Created
May 7, 2021 09:51
-
-
Save nbuchwitz/e761260687a78ad5596013a48fff4ed4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import revpimodio2 | |
def ev(name, value): | |
# payload is bytes, so we need to know the enconding (eg. ascii, utf-8, etc...) | |
print(name, value.decode('ascii')) | |
rpi = revpimodio2.RevPiModIO(autorefresh=True, monitoring=True) | |
rpi.handlesignalend() | |
# define IO: change length of string in the frm argument | |
rpi.io['Output_1_i06'].replace_io('a_string', frm='30s') | |
# register event handler function | |
rpi.io.a_string.reg_event(ev) | |
rpi.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment