Created
February 5, 2016 00:29
-
-
Save chaeplin/fb39deae2a9c2986246a to your computer and use it in GitHub Desktop.
struct data_size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct { | |
uint32_t _salt; | |
uint16_t volt; | |
int16_t data1; | |
int16_t data2; | |
uint8_t devid; | |
} data; | |
data sensor_data; | |
void setup() { | |
Serial.begin(115200); | |
Serial.println(""); | |
Serial.println(sizeof(sensor_data)); | |
} | |
void loop() { | |
} |
me-no-dev:
AVR is 8 bit
ESP is 32bit
on the esp it goes in 4 byte steps.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
!
typedef struct {
uint32_t _salt;
uint16_t volt;
int16_t data1;
} data;
--> pro mini : 8
--> esp : 8
typedef struct {
uint32_t _salt;
uint16_t volt;
int16_t data1;
uint8_t devid;
} data;
--> pro mini : 9
--> esp : 12
typedef struct {
uint32_t _salt;
uint16_t volt;
int16_t data1;
int16_t data2;
} data;
--> pro mini : 10
--> esp : 12
typedef struct {
uint32_t _salt;
uint16_t volt;
int16_t data1;
int16_t data2;
uint8_t devid;
} data;
--> pro mini : 11
--> esp : 12