user50369: When I assign a global var to a certain value inside an if-block it has been changed to another value in the next statement. Somehow the address of the var is overwritten by some other process. It also does not stop at 1 value, this happens to the next vars that are assigned another value too. The vars are not defined in a row but should be close.
I already installed a newer version of Arduino IDE, no change.
Example:
menuActive=1;
Serial.print(menuActive);

gives results in the range 40 to 57 as far as I have seen till now. Further actions assign always the SAME value to next vars I assign after this.
Anyone some idea what could cause this? Am I low on memory for local vars?
This is compile message:
Sketch uses 21790 bytes (70%) of program storage space. Maximum is 30720 bytes.
Global variables use 1454 bytes (70%) of dynamic memory, leaving 594 bytes for local variables. Maximum is 2048 bytes.

edit:
As I already said, it is 21k of code. But I show you the part of the code that mishaves: 
while ((digitalRead(rotSwPin) == 0) && lpress <= 200) {
    delay(10);
    lpress++;
    if (lpress > 200) {
        menuActive++;
        menuLvl=0;
        menuPos=0;
        subPos=0;
    }
}

Normally I use menuActive=1. Within the braces, it is still 1, out of that it changes. Maybe change from byte to bool.

user50369: I found the problem. I could see that the false value is the character code of the minute I am displaying. I display hours and minutes and there was a declaration that was 3 characters short for the string I got as a result for hours added to minutes. Yes, it was memory corruption. So be very careful to dimension enough places for your C-strings including 1 extra for 0. If you are not so short on RAM then a few more characters will do no harm, the end of the string will be the character before the 0 in memory.
When strange things happen start looking at this matter!

50369: <p>When I assign a global var to a certain value inside an if-block it has been changed to another value in the next statement. Somehow the address of the var is overwritten by some other process. It also does not stop at 1 value, this happens to the next vars that are assigned another value too. The vars are not defined in a row but should be close.
I already installed a newer version of Arduino IDE, no change.
Example:</p>

<pre><code>menuActive=1;
Serial.print(menuActive);
</code></pre>

<p>gives results in the range 40 to 57 as far as I have seen till now. Further actions assign always the SAME value to next vars I assign after this.
Anyone some idea what could cause this? Am I low on memory for local vars?
This is compile message:</p>

<pre><code>Sketch uses 21790 bytes (70%) of program storage space. Maximum is 30720 bytes.
Global variables use 1454 bytes (70%) of dynamic memory, leaving 594 bytes for local variables. Maximum is 2048 bytes.
</code></pre>

<p>edit:</p>

<p>As I already said, it is 21k of code. But I show you the part of the code that mishaves: </p>

<pre><code>while ((digitalRead(rotSwPin) == 0) &amp;&amp; lpress &lt;= 200) {
    delay(10);
    lpress++;
    if (lpress &gt; 200) {
        menuActive++;
        menuLvl=0;
        menuPos=0;
        subPos=0;
    }
}
</code></pre>

<p>Normally I use menuActive=1. Within the braces, it is still 1, out of that it changes. Maybe change from byte to bool.</p>
 50369: <p>I found the problem. I could see that the false value is the character code of the minute I am displaying. I display hours and minutes and there was a declaration that was 3 characters short for the string I got as a result for hours added to minutes. Yes, it was memory corruption. So be very careful to dimension enough places for your C-strings including 1 extra for 0. If you are not so short on RAM then a few more characters will do no harm, the end of the string will be the character before the 0 in memory.
When strange things happen start looking at this matter!</p>
