mapping values

robtillaart:

my question is do you understand what i need to do ?

Making the controller of a mixing machine my kids are not allowed to use ...

The code you post is only a snippet that does not compile, so it is hard to improve on that.

I don't know if the use of % characters in variables is acceptable,
I would prefer written version like percJagermeister as the % sign is the modulo operator in C++

The remark of PaulS is a valid one.
In C++ there is a difference in the "comparison equals ==" and the "assign equals ="

a statement
if (right = 13)
assigns the value 13 to the var right and after that it evaluates to true; so the block {} is executed.

k, thx, it wasn't my idea to make a compileable code in the first place...
but i only needed to figure out the regulation part... but now when i think i solved it, i need an extra feature:
I wan't to be able to "fool" the system when i remove my hands from the line of ultrasonic sensor, so it remembers the recent position of the hands... anyone got an idea?

P.S redbull and jegermaister were first things that came on my mind (idk. maybee cuz of that im asking you to solve my problems) :frowning: