analogRead & analogWrite, slight refactoring