O
O
oc1tane2017-07-24 16:07:37
Arduino
oc1tane, 2017-07-24 16:07:37

Tips for optimizing reading parameters from SD Arduino?

Since there is not enough space in the arduino itself, I use an SD card. It is planned to store parameters from IR signals on the card (turning on the air conditioner, turning it off, switching the temperature, etc.
)

3600, 1500, 600, 1150, 550, 400, 550, 350, 550, 400, 500, 1250, 550, 350, 550, 400, 550, 400, 550, 1200, 550, 400, 500, 400, 600, 350, 550, 1200, 550, 400, 550, 350, 600, 350, 550, 1150, 600, 350, 600, 350, 550, 400

I would like to store all commands in one example.conf file, with the following structure:
[ON]="3600, 1500, 600, 1150, 550, 400, 550, 350, 550, 400, 500, 1250, 550, 350, 550, 400, 550, 400, 550, 1200, 550, 400, 500, 400, 600, 350, 550, 1200, 550, 400, 550, 350, 600, 350, 550, 1150, 600, 350, 600, 350, 550, 400"

[OFF]="3600, 1500, 600, 1150, 550, 400, 550, 350, 550, 400, 500, 1250, 550, 350, 550, 400, 550, 400, 550, 1200, 550, 400, 500, 400, 600, 350, 550, 1200, 550, 400, 550, 350, 600, 350, 550, 1150, 600, 350, 600, 350, 550, 400"

...

But in arduino SI allows you to get the value completely as an array of values
while (myFile.available()) {
     Serial.write(myFile.read());
    }

Is it possible to somehow optimize the search for the values ​​of IR codes by the keys ON, OFF, etc...
Those do not accept all the data from the file from the map, but only what I need (For example, a code with a specific value)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
papkinv, 2017-07-26
@papkinv

Are you sure there is not enough memory in the arduino? And if you use PROGMEM - i.e. store the values ​​in ROM along with the code. Well, not in lines, of course. It's too bold on the lines.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question