About generalizing digitalRead, digitalWrite and pinMode to extender IO

Thanks Rob. I will do the attach detach. It is better.