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

#3526

please note that arraydata[] and mydata.arraydata[] are two different entities.

The line of code in the main loop:
<p class=”MsoPlainText”>int arraydata[] = {0x000001,0x1000ff,0x10ff00,0x10ffff,0xff0001};</p>
<p class=”MsoPlainText”>creates a new instance of memory, unique from mydata. The “int” at the beginning is the initializer.</p>
<p class=”MsoPlainText”>The simplest fix is to copy one array to another. See the below example where memcpy() does this.</p>
<p class=”MsoPlainText”>void loop() {</p>
<p class=”MsoPlainText”> //this is how you access the variables. [name of the group].[variable name]</p>
<p class=”MsoPlainText”>  int arraydata[] = {0x31,0x100032,0x33,0x34,0x35};</p>
<p class=”MsoPlainText”>  memcpy(mydata.arraydata, arraydata, sizeof(arraydata));</p>
<p class=”MsoPlainText”> //send the data</p>
<p class=”MsoPlainText”>Alternatively you can use pointers. as not use twice the memory.</p>