This:
char a, b; // 8 bits each
short int c, d; // 16 bits each
short int aC[2], aD[2]; // 32 bits each
int e, f; // 32 bits each
long g, h; // 32 bits each
char arrayA[3], arrayB[3]; // 24 bits each
char arrayC[4], arrayD[4]; // 32 bits each
char sbuf[80];
void setup() {
sprintf( sbuf, "%s", __TIME__);
Spark.publish( "minalloc", sbuf);
sprintf( sbuf, "chars %u %u - shorts %u %u", (char *)&a, (char *)&b, (char *)&c, (char *)&d);
Spark.publish( "minalloc", sbuf);
sprintf( sbuf, "ints %u %u - longs %u %u", (char *)&e, (char *)&f, (char *)&g, (char *)&h);
Spark.publish( "minalloc", sbuf);
sprintf( sbuf, "2shorts %u %u - 3chars %u %u", (char *)&aC, (char*)&aD, (char *)arrayA, (char *)arrayB);
Spark.publish( "minalloc", sbuf);
delay(3000); // publish delay
sprintf( sbuf, "%u %u", (unsigned long)&b-(unsigned long)&a, (unsigned long)&d-(unsigned long)&c);
Spark.publish( "minalloc", sbuf);
sprintf( sbuf, "%u %u", (unsigned long)&f-(unsigned long)&e, (unsigned long)&h-(unsigned long)&g);
Spark.publish( "minalloc", sbuf);
sprintf( sbuf, "%u %u", (unsigned long)aD-(unsigned long)aC, (unsigned long)arrayB-(unsigned long)arrayA);
Spark.publish( "minalloc", sbuf);
}
void loop() {
delay(1000);
}
renders this:
09:25:04
chars 536873564 536873565 - shorts 536873566 536873568
ints 536873572 536873576 - longs 536873580 536873584
2shorts 536873588 536873592 - 3chars 536873596 536873599
1 2
4 4
4 3