Well, I have an Arduino Nano printing high or low on a Serial port depending on if a button is pressed or not. Then I use following code for Raspbe
high
low