I'm stating to use the latest version and I'm confused. I just don't understand how to debug or understand the problem using the compiler output. What should I look for?
Martin
here is my code:
//#include <neotimer.h>
//Neotimer timer = Neotimer(1000);
const unsigned long shortPress = 300;
const unsigned long longPress = 1000;
#define ANALOG_PIN A0
int SW = 0; //Switch value
int SW_Prev = 0; //Previous switch
const int SW1 = 1024; //Analog read values
const int SW2 = 280;
const int SW3 = 74;
const int SW4 = 22;
int T1 = 1;
int T2 = 2;
int T3 = 3;
int T4 = 4;
bool FirstClick = true;
bool WaitForUnclick = false;
int Debounce_Count = 0;
const int Debounce_Iteration = 5; //Same value read target
void loop(){
ReadKeyPress();
}
void ReadKeyPress(){
DecodeKey();
IF_Selection();
}
void DecodeKey(){
int value = analogRead(ANALOG_PIN);
if (value>20){
T1 = abs(value-SW1);
T2 = abs(value-SW2);
T3 = abs(value-SW3);
T4 = abs(value-SW4);
if (T1 < T2){ SW = 1;}
else if (T2 < T3){ SW = 2;}
else if (T3 <T4){ SW = 3;}
else if (T3 <T4){ SW = 0;}
else {SW=4;}
}
}
void IF_Selection(){
//First click
if((SW > 0) && (FirstClick == true)){
FirstClick = false; //Reset because the initial click is done
SW_Prev = SW; // Keep the decoded switxh number
//timer.start(); //Start the timer
Debounce_Count++; // Count will be incremented each time the read value will be the same
}
if ((FirstClick == false) && (SW == SW_Prev)){
Debounce_Count++;
if (Debounce_Count > Debounce_Iteration){
WaitForUnclick = true;
Debounce_Count = 0;
}
}
if((FirstClick == false) && (SW != SW_Prev)){ // Reset the counter because the key has rebounce
Debounce_Count = 0;
}
}
**The compiler error info**
c:/users/utilisateur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Utilisateur\AppData\Local\Temp\arduino\cores\07a5b931729c6a4044345c40bf56605f\core.a(core_esp8266_main.cpp.o): in function `__loop_end':
C:\Users\Utilisateur\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/core_esp8266_main.cpp:245: undefined reference to `setup'
c:/users/utilisateur/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Utilisateur\AppData\Local\Temp\arduino\cores\07a5b931729c6a4044345c40bf56605f\core.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x25): undefined reference to `setup'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1