I have a sketch that uses a large array. I thought it would be easier to keep this in a separate file (like how arduino_secrets.h is typically done) and import it into a local variable
I couldnt get it to work so currently have the file laid out like this. My intention is that I would ultimately have more than one array in the file, and I can pick the one I want to use and save into a local variable in the main sketch.
#include <WiFi.h>
#include <PubSubClient.h>
#include "arduino_secrets.h"
// #include "thermistor.h"
const int thermistor[] = {
-50,667828,
-40,335671,
-30,176683,
-20,96974,
-15,72895,
-10,55298,
-5,42314,
0,32650,
1,31030,
2,29500,
3,28054,
4,26688,
5,25396,
6,24173,
7,23016,
8,21921,
9,20885,
10,19904,
11,18974,
12,18092,
13,17257,
14,16465,
15,15714,
16,15001,
17,14325,
18,13623,
19,13053,
20,12494,
21,11943,
22,11420,
23,10923,
24,10450,
25,10000,
26,9572,
27,9165,
28,8777,
29,8408,
30,8056,
35,6530,
40,5325,
45,4367,
50,3601,
55,2985,
60,2487,
65,2082,
70,1751,
75,1480,
80,1256,
85,1070,
90,916.1,
95,787.0,
100,678.6
};
// Replace with your network credentials
const char* ssid = SECRET_SSID;
const char* password = SECRET_PASS;
as you can see I commented out the line but left it there. I was that array, to be in another file with other arrays, and essentially do what is happening with the wifi credentials.
I have read some other posts but couldnt work out what I was missing. Im sure its simple but copying the wifi credentials didnt seem to like it.
I have file thermistor.h already with the same array like this
#define TABLE {
-50,667828,
-40,335671,
-30,176683,
-20,96974,
-15,72895,
-10,55298,
-5,42314,
0,32650,
1,31030,
2,29500,
3,28054,
4,26688,
5,25396,
6,24173,
7,23016,
8,21921,
9,20885,
10,19904,
11,18974,
12,18092,
13,17257,
14,16465,
15,15714,
16,15001,
17,14325,
18,13623,
19,13053,
20,12494,
21,11943,
22,11420,
23,10923,
24,10450,
25,10000,
26,9572,
27,9165,
28,8777,
29,8408,
30,8056,
35,6530,
40,5325,
45,4367,
50,3601,
55,2985,
60,2487,
65,2082,
70,1751,
75,1480,
80,1256,
85,1070,
90,916.1,
95,787.0,
100,678.6
}
Can anyone advise how I would make use of this set up or if Ive made some fundamental mistake.
Thanks