Now also reads digital inputs