I usually don't the multiply operator (*) because it uses a lot of resources, although the DUE capable to do that. This is the reason I use the "map" function.
The main problem with this operations is that the variables are the wrong type, make sure that OUT, IN and SIN are Long and after the multiplication, you can transform the long OUT into an int.
The best way to troubleshoot this is to output to the serial monitor port the 3 variables, so you can see what is going wrong.
Por favor, Identificarse para unirse a la conversación.