Background:
My goal is to use sdFat library, more precisely AnalogBinLogger example.
I want to log data from changing analog pins for example, I want to log from pin 0 to pin 3 for 5 minutes and then from pin 4 to pin 6 for another 5 mins and then from pin 7 to pin 9 for another 5 mins. that is going to be continuously which means I am going to get rid of the part where you have to enter "r" to start logging.
Regarding the time, I managed to figure it out, I am just using the value of the variable count, if my sampling rate is 1000 samples/sec for example then 5 minutes will be 1000*60*5 and the change will be done in this line:
if (Serial.available()) {
// Stop ISR calls.
adcStop();
to
if (count >1000*60*5) {
// Stop ISR calls.
adcStop();
and this worked fine.
My problem is with the changing pins:
const uint8_t PIN_LIST[] = {1};
I changed this line to
uint8_t PIN_LIST[3] = {};
First I removed the word const
, because it's not going to be constant anymore, and I just declared an empty array, and second I am changing the pins in the loop.
Here is the loop after I got rid of doing the serial input:
void loop(void) {
int i;
for (i=0;i<=12;i+3)
{
PIN_LIST[] = {i,i+1,i+2};
logData();
Serial.println("done");
}}
The problem is I get this error :
- AnalogBinLogger.ino: In function 'void loop()':
- AnalogBinLogger:808: error: expected primary-expression before ']' token
- AnalogBinLogger:808: error: expected primary-expression before '{' token
- AnalogBinLogger:808: error: expected `;' before '{' token
The line 808 is:
PIN_LIST[] = {i,i+1,i+2};
So this is the only error, any help please?
The code is so long (800+ lines) if this information is not enough and you need me to explain a part then just tell me.