Boolean doesn't want to change after unrelated float reaches 10.0

I don't understand why is this happpening. I don't think that the memory is the issue.
When "setcurrent" reaches 10.0, "a1rotbutton" doesn't want to change.

Code
I am using rotary encoder for changing both values

setvoltage never changes in that code, so it never reaches 10.0 (it's always 0.0).

By the way, that code is small enough to paste it directly to this thread (in code tags).

christop:
setvoltage never changes in that code, so it never reaches 10.0 (it's always 0.0).

By the way, that code is small enough to paste it directly to this thread (in code tags).

I'm sorry I meant "setcurrent".

You are looking in the wrong place.

You likely have a buffer overflow here  dtostrf(voltage, 3, 1, charray);

To test if this is true, change  char charray[4];into  char charray[20]; // big enough :)

J-M-L:
You are looking in the wrong place.

You likely have a buffer overflow here  dtostrf(voltage, 3, 1, charray);

To test if this is true, change  char charray[4];into  char charray[20]; // big enough :)

Thank you so much. That was the problem. I set it to 5 now becouse "setcurrent" wont go over 50. I have never had any memory managment issues before anywhere so I could not have found this without you. Again, thank you.

Don’t forget you need a trailing zero in cstrings and if the value can get negative you’ll have a minus sign in front... also read exact definition in the function for what width means