Hi,

I am completely new to arduino but trying to get a motor to move via an Hbridge with the speed related to the values coming from a joystick. I have a line of math that doesn't seem to compute. When I place 255 as the value it reads fine but the following equation always reads zero;

speedLval = ((512-xValue)/512)*255;

xValue will always be between 0 and 462. Am I missing something obvious in the equation?

Thank you in advance,

Paul