enhance and simplify DigitalPin class