Fix NUM_DIGITAL_PINS

Previously, this was 23, which is the number of the last regular digital
pin instead of the number of pins (which is 24, numbered 0 - 23).
Additionally, this number did not include the analog pins, which are for
the purposes of this constant also digital pins.