digitalRead return boolean values HIGH and LOW, these are probably defined as byte values of 0 and 1 and println is sending raw bytes, not the ascii digits. Try the following:
if (digitalRead(but))
Serial.println(“1”);
else
Serial.println(“0”);
Its good practice to avoid using the underlying implementations of things like HIGH and LOW or TRUE and FALSE. Even if the code works, it may not work the same on other platforms.
Also, are you calling refresh()? You need to call this at least every 50 ms.
And why are you setting pin 1 as output, this is serial output and is set by the startup code.