Wrote code to ensure that only positive values can be outputted by the PWM of the Arduino to protect it.