void Motor::control(unsigned short level) { #ifndef NDEBUG assert(0 <= level && level <= 1000); #endif pwmWrite(pin,levelToCtrl(level)); }
void Motor::control(int index,unsigned short level) { #ifndef NDEBUG assert(0 <= index && index <= 3); assert(0 <= level && level <= 1000); #endif pwmWrite(pin[index],levelToCtrl(level)); }