When I don't use the constrain-function it works but I want to be sure that I do not get any negative numbers.
Could someone please explain to this noob how it should be done?
This is worth looking into. I didn't check the actual code for 'map' and 'constrain' yet.
Could you fix the low and high input first ? You have low and high the other way around.
yawOut = map(yawRead, 0, 504, -255, 0); // 0 is low, 504 is high input limit.
yawOut = constrain(yawOut, -255, 0); // -255 is low, 0 is high input limit
constrain() is a macro with the ternary operator used twice. There is a special place reserved in hell for people that develop macros where functions are more appropriate.
You should constrain the input to map, not the output from map, to avoid the issue. Or, just use two if statements to do the constraining yourself.