Good evening everyone,
I have been trying for days to use SetMessage(const char* message) & SetScreenNow(Screen screen) but I can never get anything that compiles.
I got close at some point with some variation of this:
#if defined(INCLUDE_SSD1306) || defined(ENABLE_SSD1306)
namespace display {
namespace ssd1306 {
/* the enum was around at some point too but I was getting double definition error for it.
enum Screen {
SCREEN_UNSET,
SCREEN_STARTUP,
SCREEN_MESSAGE,
SCREEN_ERROR_MESSAGE,
SCREEN_PLI,
SCREEN_IMAGE, // also for animations
SCREEN_OFF,
SCREEN_DEFAULT
};
*/
void SetMessage(const char* message);
void SetScreenNow(Screen screen);
}
}
void SetMessageOLED(const char* message) {
display::ssd1306::SetMessage(message);
display::ssd1306::SetScreenNow(display::ssd1306::SCREEN_MESSAGE);
}
#endif
This was the error I got:
In file included from C:\Users\Olivier\Desktop\LightSabers\ProffieOS\ProffieOS.ino:1724:
C:\Users\Olivier\Desktop\LightSabers\ProffieOS\config\olicomplex1.6.03.0_prop_presets.h:2588:42: error: 'SSD1306Template<128, long unsigned int> display' redeclared as different kind of entity
2588 | SSD1306Template<128,uint32_t> display(&display_controller);
| ^
In file included from C:\Users\Olivier\Desktop\LightSabers\ProffieOS\config\olicomplex1.6.03.0_prop_presets.h:426,
from C:\Users\Olivier\Desktop\LightSabers\ProffieOS\ProffieOS.ino:701:
C:\Users\Olivier\Desktop\LightSabers\ProffieOS\props\multi_prop.h:192:11: note: previous declaration 'namespace display { }'
192 | namespace display {
| ^~~~~~~
exit status 1
Compilation error: 'SSD1306Template<128, long unsigned int> display' redeclared as different kind of entity
Since that was a new error, I thought: there are two “display”, a folder and a variable. I am sure there must be a better way but since i don’t any better, I choose to re-name the variable “dislpay” to “oled_display” in ssd1306.h and in my config for the bullet count. This compiles if I do not use multi_prop.h
Arduino seemed like it was going to compile since the progress bar was going much further than usual but before the end again:
undefined reference to
display::ssd1306::SetMessage(char const*)'&
undefined reference to display::ssd1306::SetScreenNow(display::ssd1306::Screen)'
are back just the same when I started back in October.
I would highly appreciate some help or explanation about what am I doing wrong or if this can even be possible.
My goals/hopes are:
- with multi_prop.h, to be able to send “prop_mode” message changes to the OLED.
- with jetpack_prop.h to be able to send “jetpack_status” messages to the OLED & eventually to be able to send animations to the OLED for the jetpack/missile function.
- with morsecode_prop.h, to have the typed morse code on the top line and the decoded character on the bottom line ideally in both Starjedi and Aurebesh at the same time.
Is any of this possible/impossible ?
Thank you for reading this far, thank you for your time.