Home Forums EasyTransfer Library Support Forum Easy Transfer Array Populating (from SD?) Reply To: Easy Transfer Array Populating (from SD?)

#3524

As for your array issue I suspect something un-related to this library.

 

the following snippet works:

 

#define LENGTH_OF_ARRAY(x) ((sizeof(x)/sizeof(x[0])))

int arraydata[] = {0x000000,0x0000ff,0x00ff00,0x00ffff,0xff0000};

void setup() {

// put your setup code here, to run once:

Serial.begin(9600);

while (!Serial) {

; // wait for serial port to connect. Needed for native USB port only

}

Serial.println(“Hit any key to continue.”);

Serial.flush(); //flush all previous received and transmitted data

while(!Serial.available()) ;

for (uint8_t channel = 0; channel < LENGTH_OF_ARRAY(arraydata); channel++) {

Serial.print(“arraydata[“);

Serial.print(channel);

Serial.print(“]=”);

Serial.println(arraydata[channel]);

}

}

void loop() {

// put your main code here, to run repeatedly:

 

}

with the following results:

Hit any key to continue.

arraydata[0]=0

arraydata[1]=255

arraydata[2]=-256

arraydata[3]=-1

arraydata[4]=0