digital_read() wasn't shifted right

Only a mask was applied, not shifted to first position.