I am having some problems getting this code to work correctly. I have copied and pasted the error report below the code. To start with I wasn't sure if the board was working correctly so I carried out some tests , the board is in working order and the USB cable is fine. I need some ideas on how to resolve this please.
class DaysOfWeek {
enum Days { Sun, Mon, tue, Wed, thu, Fri, Sat };
Days Day;
void setup() {
// Serial.begin(115200);
Day = Days::Mon;
String Weekday = (String)DaysOfWeek::Mon;
String WeekEnd = (String)DaysOfWeek::Sat;
}
void loop()
{
}
};
/*:Arduino: 1.8.15 (Windows 10), Board: "Arduino Ethernet"
C:\Users\David\AppData\Local\Temp\ccZoFLRL.ltrans0.ltrans.o: In function `main':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Ethernet.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
*/
/* setup();
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
return 0;
}
*/
The formatting should give you a clue. Your setup() and loop() functions should start in column 1 (aka global level) and since yours do not, they must be part of a previous structure, aka your class definition.