Sharing data between two arduinos


i have structure holds bunch of data, unsigned ints , unsigned longs.  i'd send of arduino. 

does know if arduino compiler guarantees memory layout same?  afaik c (at least c99 compliant c) don't know c++.

in other words, if declare struct:

code: [select]

struct
{
  unsigned long lastupdated;
  unsigned int ahin, ahout;
  unsigned long amsecin, amsecout;
  unsigned int vmin, vmax;
  unsigned int vavg;
  unsigned int imin, imax;
  unsigned char tmin, tmax;
  unsigned char chargemin, chargemax;
  unsigned long cnowmsec;
  unsigned int socload, soccalc, socsense;
} history;


can send out comm port binary blob , receive on other end binary blob , stick identical structure?  (with appropriate error checking , such...)

you can't send struct "through comm port". serial data can sent out byte byte, if want send entire struct, should modify struct use union appropriate sized byte array.


Arduino Forum > Using Arduino > Programming Questions > Sharing data between two arduinos


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

Rasperry Wifi LAN Controller - Raspberry Pi Forums

Unlock car with bluetooth and car key