typedef struct StructOne
{
uint8_t member1;
int32_t member2;
} StructOne;
typedef struct StructTwo
{
String member1[10];
} StructTwo;
typedef struct StructThree
{
uint8_t member2;
uint8_t member1;
} StructThree;
uint16_t A_hall;
typedef struct {
uint8_t direction_s; // stavy tlačítek načtu 16 bit a rozdělím low a high (8bit) do direction_s/l
uint8_t direction_l;
uint8_t stop; // nastavuje řídící logika
uint8_t occupied;
uint8_t locked;
} S_track_control; // POZOR název je za deklarací { }
typedef struct { // index odpovídá číslu koleje 0 ... 7
uint16_t speed_rqst;
uint16_t speed_last;
uint16_t speed_new;
} S_track_speed;
S_track_control A_track_control[8]; // koleje ve stanici A - ovládání
S_track_speed A_track_speed[8]; // koleje ve stanici A - rychlost
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
size_t size_struct_one = sizeof(StructOne);
size_t size_struct_two = sizeof(StructTwo);
size_t size_struct_three = sizeof(StructThree);
size_t size_struct_A_hall = sizeof(A_hall);
printf("Size of StructOne = %u\n", sizeof(StructOne));
printf("Size of StructTwo = %u\n", sizeof(StructTwo));
printf("Size of StructThree = %u\n", sizeof(StructThree));
printf("Size of A_hall = %u\n", sizeof(A_hall));
printf("Size of A_track_control = %u\n", sizeof(A_track_control));
printf("Size of A_track_speed = %u\n", sizeof(A_track_speed));
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}