I want to avoid a “undeclared (first use in this function)” error, and keep my events in the ui_events.c file if possible.
I have an event that successfully calls a function, and it’s perfectly placed in ui_events.c. However, when I try and put something in that function (such as a Serial.Println(“test”);), I get an “undeclared” warning. If I remove the function from ui_evcents.c and put it in my main .ino file, all is groovy. I know I must be missing something simple in how C does this (my background is C++, so I know I’m missing something here).
/Users/mark/Documents/lvgl_testing/SmartVac/ui_events.c: In function 'splashMuppet': ui_events.c:10:3: error: 'Serial' undeclared (first use in this function) Serial.println("t"); ^~~~~~ /Users/mark/Documents/lvgl_testing/SmartVac/ui_events.c:10:3: note: each undeclared identifier is reported only once for each function it appears in exit status 1 'Serial' undeclared (first use in this function)
- SquareLine Studio version: — 1.1.0
- Operating system: — MacOs, Arduino editor 1.8.19
- Target hardware: — Arduino nano RP2040 Connect