Save int like EEPROM

Is there a way to save a number other than EEPROM?

Say if i had a counter and I was wanting to push a button to save that value but only when the power is on.

RAM

I suspect that there may be more to the question than meets the eye. Can you please expand on what you want to do and why ?

Is it perhaps related to this thread ?

I'm working on a automated Sawmill and I was playing around with rotary encoders as I will be using them to keep track of the saw position. I was trying to find a way to store the start position and end position of the log. So the sketch will have that info to run on. I can use the EEPROM but I was looking into options.

And thanks for the for loop info but I'm not seeing how that is going to help with storing info. It did help with cycling the depth though

I can use the EEPROM but I was looking into options.

As illustrated in the thread that I linked to you can simply do this

cutDepth += thickness;

The thickness variable is added to the current value of the cutDepth variable and the result is put in the cutDepth variable.

Want to increment a variable named counter ?

counter++;

Job done

Where are the start/end dimensions coming from? Sensors, keypad...where? Surely you can store the values in variables that are held in SRAM, probably as globals, that can be reset with each new log. I guess I don't understand the problem, nor why you would want to etch them into EEPROM when they are no longer needed after the log is cut.

econjack:
Where are the start/end dimensions coming from? Sensors, keypad...where? Surely you can store the values in variables that are held in SRAM, probably as globals, that can be reset with each new log. I guess I don't understand the problem, nor why you would want to etch them into EEPROM when they are no longer needed after the log is cut.

That's correct I dont want to store them into EEPROM and yes after the log has been cut they are done. I will look into SRAM though. The saw and deck positions are coming from a encoder.

What I'm wanting to do is run the saw up to the beginning of the log either reset the controller or set the position. Then run the saw to the end of the log and set the ending position say its 10,000 steps.

Then I can use those int as a beginning and ending for the loop.

Unless there is an easier way that you guys can think of doing it.

UKHeliBob:
As illustrated in the thread that I linked to you can simply do this

cutDepth += thickness;

The thickness variable is added to the current value of the cutDepth variable and the result is put in the cutDepth variable.

Want to increment a variable named counter ?

counter++;

Job done

And thanks again the for loop did solve the thickness issue.