void thrusterSouthUp(int pwm, int isUpward) { pwm = btd117(pwm); analogWrite(pwmPinSouthUp, pwm); if (isUpward) { digitalWrite(directionPinSouthUp1, HIGH); digitalWrite(directionPinSouthUp2, LOW); } else { digitalWrite(directionPinSouthUp1, LOW); digitalWrite(directionPinSouthUp2, HIGH); } }
void thrusterNorthUp(int pwm, int isUpward) { pwm = abs(pwm); pwm = btd117(pwm); analogWrite(pwmPinNorthUp, 255 - pwm); if (isUpward) { digitalWrite(directionPinNorthUp1, HIGH); digitalWrite(directionPinNorthUp2, LOW); } else { digitalWrite(directionPinNorthUp1, LOW); digitalWrite(directionPinNorthUp2, HIGH); } }