hi im getting this error message, tried to look after solutions in this forum but none of them worked.I am declaring this gpio pins as the example sketch (GPIO/GPIO interrupt) in the IDE. i am working with an ESP32 devkit. all the code below is outside and before any functions(setup(), loop() etc.
code:
//GPIO declarations.
struct GPIO {
const uint8_t PIN; // gpio pin assingment
uint32_t timesAct;// how many times it has been triggered.
bool state; //stores state.
};
GPIO btn1 = {34,0,false};
GPIO btn2 = {35,0,false};
GPIO btn3 = {32,0,false};
GPIO btn4 = {33,0,false};
GPIO ledW = {13,0,false};
GPIO ledG = {12,0,false};
GPIO ledY = {14,0,false};
GPIO ledR = {27,0,false};
When OP is saying -
"hi im getting this error message [...].", I am expecting to see the following error message that has been reported in the IDE.
test-1:17:1: error: 'GPIO' does not name a type
GPIO btn1 = {34, 0, false};
^~~~
Traditionally, GPIO stands for "General Purpose IO". As it (GPIO with capital letters) has pre-defined meaning in the ESP32 Core/Environment (post #2), we may use gpio (with small letters) instead.
yes i knew what GPIO stands for, thats why when i was declaring gpio pins i chose that name. i made the problem on my own xd. Also, thank you on your opinion about how to write a topic. it is the first time i open a discussion.
have a good weekend!