Answer the question
In order to leave comments, you need to log in
Why does an error occur when accessing a struct?
I use Atme Studio
The structure is this:
struct button {
char *button_port;
uint8_t button_pin;
uint8_t flagPress;
uint8_t flagClick;
uint8_tbuttonCount;
uint8_t time_button;
} button_left, button_right, button_menu;
It is necessary to set the initial parameters of the buttons.
It doesn't work like this: button_left.button_port = "PORTD"; writes
Error expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
This is how it works:
struct button button_left = {"PORTD", 6, 0, 0, 0, 12};
Answer the question
In order to leave comments, you need to log in
It doesn't work like this: button_left.button_port = "PORTD";
And this is how it works:
struct button button_left = {"PORTD", 6, 0, 0, 0, 12};
Why does an error occur when accessing a struct?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question