I'm making some code for a motorcontroller. The arduino receives a negative number when the motor is supposed to spin backwards.
The value tells the desired speed as well.
To my understanding I can't write: analogwrite(pwmPin, -155), so
I need to make an integer value change sign.
Like, if I have an integer called "x", and the value of x is -135.
How do I write the software to change the sign to + so the new value will be 135?
Thanks in advance