/// <summary> /// readButtons /// read the state of the 5 buttons on the plate /// returns bitmap /// </summary> /// <returns>byte</returns> public byte readButtons() { byte reply = 0x1F; for (byte i = 0; i < 5; i++) { reply &= (byte)~((byte)(MCP.digitalRead(ButtonPins[i])) << i); } return(reply); }