I am working on an indicator project. However, the ram of the Arduino mega is insufficient. Is there any way to drop this in the library ? Button, number etc. The ram ran out as we created the objects. I shared what I have define below. I haven't entered the ID's yet. You can ignore them.
Thank you.
Arduino Warning
Sketch uses 21184 bytes (8%) of program storage space. Maximum is 253952 bytes. Global variables use 6747 bytes (82%) of dynamic memory, leaving 1445 bytes for local variables. Maximum is 8192 bytes. Low memory available, stability problems may occur.
`Nextion *next = Nextion::GetInstance(Serial3); // HW serial
Hi,
I am working on an indicator project. However, the ram of the Arduino mega is insufficient. Is there any way to drop this in the library ? Button, number etc. The ram ran out as we created the objects. I shared what I have define below. I haven't entered the ID's yet. You can ignore them.
Thank you.
Arduino Warning
Sketch uses 21184 bytes (8%) of program storage space. Maximum is 253952 bytes. Global variables use 6747 bytes (82%) of dynamic memory, leaving 1445 bytes for local variables. Maximum is 8192 bytes. Low memory available, stability problems may occur.
`Nextion *next = Nextion::GetInstance(Serial3); // HW serial
NexPage introPage(next, 0, "introPage"); NexPage mainPage(next, 1, "mainPage"); NexPage settingsPage(next, 2, "settingsPage"); NexPage peekPage(next, 3, "peekPage"); NexPage faultPage(next, 4, "faultPage");
NexPage ethanolPage(next, 5, "ethanolPage"); NexPage cltPage(next, 6, "cltPage"); NexPage iatPage(next, 7, "iatPage"); NexPage fuelPressPage(next, 8, "fuelPressPage"); NexPage tanklevelPage(next, 9, "tanklevelPage"); NexPage boostPage(next, 10, "boostPage"); NexPage rpmPage(next, 11, "rpmPage"); NexPage oilPressPage(next, 12, "oilPressPage"); NexPage oilTempPage(next, 13, "oilTempPage"); NexPage egtPage(next, 14, "egtPage"); NexPage afrPage(next, 15, "afrPage");
NexButton mainPageSettingsButton ( next, 0, 6, "mainPageSettingsButton", &mainPage);
NexButton mainPagePeekButton ( next, 0, 6, "mainPagePeekButton", &mainPage);
NexButton mainPageFaultButton ( next, 0, 6, "mainPageFaultButton", &mainPage);
NexButton faultPageReturnMainPageButton ( next, 0, 6, "faultPageReturnMainPageButton", &faultPage);
NexButton peekPageReturnMainPageButton ( next, 0, 6, "peekPageReturnMainPageButton", &peekPage);
NexButton settingsPageReturnMainPageButton ( next, 0, 6, "settingsPageReturnMainPageButton", &settingsPage);
NexButton faultPageFaultResetButton ( next, 0, 6, "faultPageFaultResetButton", &faultPage);
NexDSButton settingsPageEthanolPeakOnOffButton ( next, 0, 11, "settingsPageEthanolPeakOnOffButton", &settingsPage); NexDSButton settingsPageCltPeakOnOffButton ( next, 0, 11, "settingsPageCltPeakOnOffButton", &settingsPage); NexDSButton settingsPageIatPeakOnOffButton ( next, 0, 11, "settingsPageIatPeakOnOffButton", &settingsPage); NexDSButton settingsPageFuelPressPeakOnOffButton ( next, 0, 11, "settingsPageFuelPressPeakOnOffButton", &settingsPage); NexDSButton settingsPageTankLevelPeakOnOffButton ( next, 0, 11, "settingsPageTankLevelPeakOnOffButton", &settingsPage); NexDSButton settingsPageBoostPeakOnOffButton ( next, 0, 11, "settingsPageBoostPeakOnOffButton", &settingsPage); NexDSButton settingsPageRpmPeakOnOffButton ( next, 0, 11, "settingsPageRpmPeakOnOffButton", &settingsPage); NexDSButton settingsPageOilPressPeakOnOffButton ( next, 0, 11, "settingsPageOilPressPeakOnOffButton", &settingsPage); NexDSButton settingsPageOilTempPeakOnOffButton ( next, 0, 11, "settingsPageOilTempPeakOnOffButton", &settingsPage); NexDSButton settingsPageEgt1PeakOnOffButton ( next, 0, 11, "settingsPageEgt1PeakOnOffButton", &settingsPage); NexDSButton settingsPageEgt2PeakOnOffButton ( next, 0, 11, "settingsPageEgt2PeakOnOffButton", &settingsPage); NexDSButton settingsPageAfrPeakOnOffButton ( next, 0, 11, "settingsPageAfrPeakOnOffButton", &settingsPage);
NexButton settingsPageEthanolHighLimitUpButton ( next, 0, 11, "settingsPageEthanolHighLimitUpButton", &settingsPage); NexButton settingsPageCltHighLimitUpButton ( next, 0, 11, "settingsPageCltHighLimitUpButton", &settingsPage); NexButton settingsPageIatHighLimitUpButton ( next, 0, 11, "settingsPageIatHighLimitUpButton", &settingsPage); NexButton settingsPageFuelPressHighLimitUpButton ( next, 0, 11, "settingsPageFuelPressHighLimitUpButton", &settingsPage); NexButton settingsPageTankLevelHighLimitUpButton ( next, 0, 11, "settingsPageTankLevelHighLimitUpButton", &settingsPage); NexButton settingsPageBoostHighLimitUpButton ( next, 0, 11, "settingsPageBoostHighLimitUpButton", &settingsPage); NexButton settingsPageRpmHighLimitUpButton ( next, 0, 11, "settingsPageRpmHighLimitUpButton", &settingsPage); NexButton settingsPageOilPressHighLimitUpButton ( next, 0, 11, "settingsPageOilPressHighLimitUpButton", &settingsPage); NexButton settingsPageOilTempHighLimitUpButton ( next, 0, 11, "settingsPageOilTempHighLimitUpButton", &settingsPage); NexButton settingsPageEgt1HighLimitUpButton ( next, 0, 11, "settingsPageEgt1HighLimitUpButton", &settingsPage); NexButton settingsPageEgt2HighLimitUpButton ( next, 0, 11, "settingsPageEgt2HighLimitUpButton", &settingsPage); NexButton settingsPageAfrHighLimitUpButton ( next, 0, 11, "settingsPageAfrHighLimitUpButton", &settingsPage);
NexButton settingsPageEthanolHighLimitDownButton ( next, 0, 11, "settingsPageEthanolHighLimitDownButton", &settingsPage); NexButton settingsPageCltHighLimitDownButton ( next, 0, 11, "settingsPageCltHighLimitDownButton", &settingsPage); NexButton settingsPageIatHighLimitDownButton ( next, 0, 11, "settingsPageIatHighLimitDownButton", &settingsPage); NexButton settingsPageFuelPressHighLimitDownButton ( next, 0, 11, "settingsPageFuelPressHighLimitDownButton", &settingsPage); NexButton settingsPageTankLevelHighLimitDownButton ( next, 0, 11, "settingsPageTankLevelHighLimitDownButton", &settingsPage); NexButton settingsPageBoostHighLimitDownButton ( next, 0, 11, "settingsPageBoostHighLimitDownButton", &settingsPage); NexButton settingsPageRpmHighLimitDownButton ( next, 0, 11, "settingsPageRpmHighLimitDownButton", &settingsPage); NexButton settingsPageOilPressHighLimitDownButton ( next, 0, 11, "settingsPageOilPressHighLimitDownButton", &settingsPage); NexButton settingsPageOilTempHighLimitDownButton ( next, 0, 11, "settingsPageOilTempHighLimitDownButton", &settingsPage); NexButton settingsPageEgt1HighLimitDownButton ( next, 0, 11, "settingsPageEgt1HighLimitDownButton", &settingsPage); NexButton settingsPageEgt2HighLimitDownButton ( next, 0, 11, "settingsPageEgt2HighLimitDownButton", &settingsPage); NexButton settingsPageAfrHighLimitDownButton ( next, 0, 11, "settingsPageAfrHighLimitDownButton", &settingsPage);
NexButton settingsPageEthanolLowLimitUpButton ( next, 0, 11, "settingsPageEthanolLowLimitUpButton", &settingsPage); NexButton settingsPageCltLowLimitUpButton ( next, 0, 11, "settingsPageCltLowLimitUpButton", &settingsPage); NexButton settingsPageIatLowLimitUpButton ( next, 0, 11, "settingsPageIatLowLimitUpButton", &settingsPage); NexButton settingsPageFuelPressLowLimitUpButton ( next, 0, 11, "settingsPageFuelPressLowLimitUpButton", &settingsPage); NexButton settingsPageTankLevelLowLimitUpButton ( next, 0, 11, "settingsPageTankLevelLowLimitUpButton", &settingsPage); NexButton settingsPageBoostLowLimitUpButton ( next, 0, 11, "settingsPageBoostLowLimitUpButton", &settingsPage); NexButton settingsPageRpmLowLimitUpButton ( next, 0, 11, "settingsPageRpmLowLimitUpButton", &settingsPage); NexButton settingsPageOilPressLowLimitUpButton ( next, 0, 11, "settingsPageOilPressLowLimitUpButton", &settingsPage); NexButton settingsPageOilTempLowLimitUpButton ( next, 0, 11, "settingsPageOilTempLowLimitUpButton", &settingsPage); NexButton settingsPageEgt1LowLimitUpButton ( next, 0, 11, "settingsPageEgt1LowLimitUpButton", &settingsPage); NexButton settingsPageEgt2LowLimitUpButton ( next, 0, 11, "settingsPageEgt2LowLimitUpButton", &settingsPage); NexButton settingsPageAfrLowLimitUpButton ( next, 0, 11, "settingsPageAfrLowLimitUpButton", &settingsPage);
NexButton settingsPageEthanolLowLimitDownButton ( next, 0, 11, "settingsPageEthanolLowLimitDownButton", &settingsPage); NexButton settingsPageCltLowLimitDownButton ( next, 0, 11, "settingsPageCltLowLimitDownButton", &settingsPage); NexButton settingsPageIatLowLimitDownButton ( next, 0, 11, "settingsPageIatLowLimitDownButton", &settingsPage); NexButton settingsPageFuelPressLowLimitDownButton ( next, 0, 11, "settingsPageFuelPressLowLimitDownButton", &settingsPage); NexButton settingsPageTankLevelLowLimitDownButton ( next, 0, 11, "settingsPageTankLevelLowLimitDownButton", &settingsPage); NexButton settingsPageBoostLowLimitDownButton ( next, 0, 11, "settingsPageBoostLowLimitDownButton", &settingsPage); NexButton settingsPageRpmLowLimitDownButton ( next, 0, 11, "settingsPageRpmLowLimitDownButton", &settingsPage); NexButton settingsPageOilPressLowLimitDownButton ( next, 0, 11, "settingsPageOilPressLowLimitDownButton", &settingsPage); NexButton settingsPageOilTempLowLimitDownButton ( next, 0, 11, "settingsPageOilTempLowLimitDownButton", &settingsPage); NexButton settingsPageEgt1LowLimitDownButton ( next, 0, 11, "settingsPageEgt1LowLimitDownButton", &settingsPage); NexButton settingsPageEgt2LowLimitDownButton ( next, 0, 11, "settingsPageEgt2LowLimitDownButton", &settingsPage); NexButton settingsPageAfrLowLimitDownButton ( next, 0, 11, "settingsPageAfrLowLimitDownButton", &settingsPage);
uint32_t mainPageSettingsButtonState; uint32_t mainPagePeekButtonState;
uint32_t mainPageFaultButtonState; uint32_t faultPageReturnMainPageButtonState; uint32_t peekPageReturnMainPageButtonState; uint32_t settingsPageReturnMainPageButtonState; uint32_t faultPageFaultResetButtonState; uint32_t settingsPageEthanolPeakOnOffButtonState; uint32_t settingsPageCltPeakOnOffButtonState; uint32_t settingsPageIatPeakOnOffButtonState; uint32_t settingsPageFuelPressPeakOnOffButtonState; uint32_t settingsPageTankLevelPeakOnOffButtonState; uint32_t settingsPageBoostPeakOnOffButtonState; uint32_t settingsPageRpmPeakOnOffButtonState; uint32_t settingsPageOilPressPeakOnOffButtonState; uint32_t settingsPageOilTempPeakOnOffButtonState; uint32_t settingsPageEgt1PeakOnOffButtonState; uint32_t settingsPageEgt2PeakOnOffButtonState; uint32_t settingsPageAfrPeakOnOffButtonState; uint32_t settingsPageEthanolHighLimitUpButtonState; uint32_t settingsPageCltHighLimitUpButtonState; uint32_t settingsPageIatHighLimitUpButtonState; uint32_t settingsPageFuelPressHighLimitUpButtonState; uint32_t settingsPageTankLevelHighLimitUpButtonState; uint32_t settingsPageBoostHighLimitUpButtonState; uint32_t settingsPageRpmHighLimitUpButtonState; uint32_t settingsPageOilPressHighLimitUpButtonState; uint32_t settingsPageOilTempHighLimitUpButtonState; uint32_t settingsPageEgt1HighLimitUpButtonState; uint32_t settingsPageEgt2HighLimitUpButtonState; uint32_t settingsPageAfrHighLimitUpButtonState; uint32_t settingsPageEthanolHighLimitDownButtonState; uint32_t settingsPageCltHighLimitDownButtonState; uint32_t settingsPageIatHighLimitDownButtonState; uint32_t settingsPageFuelPressHighLimitDownButtonState; uint32_t settingsPageTankLevelHighLimitDownButtonState; uint32_t settingsPageBoostHighLimitDownButtonState; uint32_t settingsPageRpmHighLimitDownButtonState; uint32_t settingsPageOilPressHighLimitDownButtonState; uint32_t settingsPageOilTempHighLimitDownButtonState; uint32_t settingsPageEgt1HighLimitDownButtonState; uint32_t settingsPageEgt2HighLimitDownButtonState; uint32_t settingsPageAfrHighLimitDownButtonState; uint32_t settingsPageEthanolLowLimitUpButtonState; uint32_t settingsPageCltLowLimitUpButtonState; uint32_t settingsPageIatLowLimitUpButtonState; uint32_t settingsPageFuelPressLowLimitUpButtonState; uint32_t settingsPageTankLevelLowLimitUpButtonState; uint32_t settingsPageBoostLowLimitUpButtonState; uint32_t settingsPageRpmLowLimitUpButtonState; uint32_t settingsPageOilPressLowLimitUpButtonState; uint32_t settingsPageOilTempLowLimitUpButtonState; uint32_t settingsPageEgt1LowLimitUpButtonState; uint32_t settingsPageEgt2LowLimitUpButtonState; uint32_t settingsPageAfrLowLimitUpButtonState; uint32_t settingsPageEthanolLowLimitDownButtonState; uint32_t settingsPageCltLowLimitDownButtonState; uint32_t settingsPageIatLowLimitDownButtonState; uint32_t settingsPageFuelPressLowLimitDownButtonState; uint32_t settingsPageTankLevelLowLimitDownButtonState; uint32_t settingsPageBoostLowLimitDownButtonState; uint32_t settingsPageRpmLowLimitDownButtonState; uint32_t settingsPageOilPressLowLimitDownButtonState; uint32_t settingsPageOilTempLowLimitDownButtonState; uint32_t settingsPageEgt1LowLimitDownButtonState; uint32_t settingsPageEgt2LowLimitDownButtonState; uint32_t settingsPageAfrLowLimitDownButtonState;
NexNumber mainPageRealTimeEthanol ( next, 1, 6, "mainPageRealTimeEthanol", &mainPage);
NexNumber mainPageRealTimeClt ( next, 1, 10, "mainPageRealTimeClt", &mainPage); NexNumber mainPageRealTimeIat ( next, 1, 6, "mainPageRealTimeIat", &mainPage);
NexNumber mainPageRealTimeFuelPress ( next, 1, 10, "mainPageRealTimeFuelPress", &mainPage);
NexNumber mainPageRealTimeTankLevel ( next, 1, 6, "mainPageRealTimeTankLevel", &mainPage);
NexNumber mainPageRealTimeBoost ( next, 1, 10, "mainPageRealTimeBoost", &mainPage);
NexNumber mainPageRealTimeOilPress ( next, 1, 6, "mainPageRealTimeOilPress", &mainPage);
NexNumber mainPageRealTimeOilTemp ( next, 1, 10, "mainPageRealTimeOilTemp", &mainPage);
NexNumber mainPageRealTimeEgt1 ( next, 1, 6, "mainPageRealTimeEgt1", &mainPage);
NexNumber mainPageRealTimeEgt2 ( next, 1, 10, "mainPageRealTimeEgt2", &mainPage);
NexNumber mainPageRealTimeAfr ( next, 1, 6, "mainPageRealTimeAfr", &mainPage); NexGauge mainPageRealTimeRpm ( next, 1, 6, "mainPageRealTimeRpm", &mainPage);
NexProgressBar mainPageRealTimeBoostBar ( next, 1, 6, "mainPageRealTimeBoostBar", &mainPage); NexScrolltext mainPageRealTimeFaultCode( next, 1, 6, "mainPageRealTimeFaultCode", &mainPage);
NexNumber settingsPageHighLimitEthanol ( next, 1, 6, "settingsPageHighLimitEthanol", &settingsPage);
NexNumber settingsPageHighLimitClt ( next, 1, 10, "settingsPageHighLimitClt", &settingsPage); NexNumber settingsPageHighLimitIat ( next, 1, 6, "settingsPageHighLimitIat", &settingsPage);
NexNumber settingsPageHighLimitFuelPress ( next, 1, 10, "settingsPageHighLimitFuelPress", &settingsPage);
NexNumber settingsPageHighLimitTankLevel ( next, 1, 6, "settingsPageHighLimitTankLevel", &settingsPage);
NexNumber settingsPageHighLimitBoost ( next, 1, 10, "settingsPageHighLimitBoost", &settingsPage);
NexNumber settingsPageHighLimitOilPress ( next, 1, 6, "settingsPageHighLimitOilPress", &settingsPage);
NexNumber settingsPageHighLimitOilTemp ( next, 1, 10, "settingsPageHighLimitOilTemp", &settingsPage);
NexNumber settingsPageHighLimitEgt1 ( next, 1, 6, "settingsPageHighLimitEgt1", &settingsPage);
NexNumber settingsPageHighLimitEgt2 ( next, 1, 10, "settingsPageHighLimitEgt2", &settingsPage);
NexNumber settingsPageHighLimitAfr ( next, 1, 6, "settingsPageHighLimitAfr", &settingsPage); NexNumber settingsPageHighLimitRpm ( next, 1, 6, "settingsPageHighLimitRpm", &settingsPage);
NexNumber settingsPageLowLimitEthanol ( next, 1, 6, "settingsPageLowLimitEthanol", &settingsPage);
NexNumber settingsPageLowLimitClt ( next, 1, 10, "settingsPageLowLimitClt", &settingsPage); NexNumber settingsPageLowLimitIat ( next, 1, 6, "settingsPageLowLimitIat", &settingsPage);
NexNumber settingsPageLowLimitFuelPress ( next, 1, 10, "settingsPageLowLimitFuelPress", &settingsPage);
NexNumber settingsPageLowLimitTankLevel ( next, 1, 6, "settingsPageLowLimitTankLevel", &settingsPage);
NexNumber settingsPageLowLimitBoost ( next, 1, 10, "settingsPageLowLimitBoost", &settingsPage);
NexNumber settingsPageLowLimitOilPress ( next, 1, 6, "settingsPageLowLimitOilPress", &settingsPage);
NexNumber settingsPageLowLimitOilTemp ( next, 1, 10, "settingsPageLowLimitOilTemp", &settingsPage);
NexNumber settingsPageLowLimitEgt1 ( next, 1, 6, "settingsPageLowLimitEgt1", &settingsPage);
NexNumber settingsPageLowLimitEgt2 ( next, 1, 10, "settingsPageLowLimitEgt2", &settingsPage);
NexNumber settingsPageLowLimitAfr ( next, 1, 6, "settingsPageLowLimitAfr", &settingsPage); NexNumber settingsPageLowLimitRpm ( next, 1, 6, "settingsPageLowLimitRpm", &settingsPage);`