setting AnalogPwm, adapted to testing board, added readCurrent and readCurrent Average, refactor