You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an ESP8266 and a SSD1309 display.
All GPIO settings are stored in a separate file.
The Wire library is launched after receiving GPIO numbers from SPIFFS, and services some sensors.
How can I change the sketch so that after reading SPIFFS I can pass GPIO numbers to the constructor?
Make your display variable (u8g2) a pointer, then use a u8g2 = new U8G2_SSD1309_128X64_NONAME0_F_SW_I2C(...) in Setup. Requires dynamic memory allocation, so YMMV.
Come up with a way to use placement new if you want to avoid the dynamic allocation while also dodging automatic initialization. Probably use some kind of a union?
Use the generic U8G2 class for u8g2, then call the corresponding setup functions manually. Use u8g2.getU8g2() and u8g2.getU8x8() to get corresponding internal C structs needed for these calls.
Out of these 3, the third option seems like the most reliable to me, although it's not quite as pretty as using a pre-made constructor.
There is an ESP8266 and a SSD1309 display.
All GPIO settings are stored in a separate file.
The Wire library is launched after receiving GPIO numbers from SPIFFS, and services some sensors.
How can I change the sketch so that after reading SPIFFS I can pass GPIO numbers to the constructor?
This is a sample.
The text was updated successfully, but these errors were encountered: