Programming-Arduino (1) - Pages-148
Programming-Arduino (1) - Pages-148
Data Storage
When you give values to variables, the Arduino board will remember those
values only as long as the power is on. The moment that you turn the power off
or reset the board, all that data is lost.
In this chapter, we look at some ways to hang on to that data.
Constants
If the data that you want to store does not change, then you can just set the data
up each time that the Arduino starts. An example of this approach is the case in
the letters array in your Morse code translator of Chapter 5 (sketch 5-05).
You used the following code to define a variable of the correct size and fill it
with the data that you needed:
char* letters[] = {