Read multiple buttons on one pin

Based on
http://darauble.wordpress.com/2013/06/24/arduino-ir-mygtukai-laidu-taupymas/

Note: this is not tested and value-calibrated yet.