Partition I'm using:
# Name Type SubType Offset Size Flags
nvs data nvs 0x9000 0x5000
otadata data ota 0xe000 0x2000
app0 app ota_0 0x10000 0xc00000
spiffs data spiffs 0xc10000 0xe0000
coredump data coredump 0xcf0000 0x310000
My current code (Not finished)
- #include <TFT_eSPI.h>
- #include <Arduino.h>
- #include "Mustang_Running_1st.h"
- #include "Mustang_Running_2nd.h"
- #include "Mustang_Running_3rd.h"
- #include "Mustang_Running_4th.h"
- #include "Mustang_Running_5th.h"
- #include "Mustang_Running_Rev.h"
- #include "Mustang_Neutral.h"
- TFT_eSPI tft = TFT_eSPI();
- void setup() {
- // put your setup code here, to run once:
- Serial.begin(115200);
- pinMode(15, INPUT);
- tft.begin();
- tft.setRotation(0);
- tft.fillScreen(TFT_BLACK);
- tft.setSwapBytes(true);
- tft.setTextFont(2);
- }
- int inc = 0;
- void loop() {
- // put your main code here, to run repeatedly:
- char currentGear = 'N';
- int hallValue0 = analogRead(15);
- int hallValue1 = analogRead(16);
- int hallValue2 = analogRead(17);
- int hallValue3 = analogRead(18);
- Serial.println(hallValue0);
- Serial.println(hallValue1);
- Serial.println(hallValue2);
- Serial.println(hallValue3);
- if (hallValue0 >= 2285 && hallValue0 <=2350){
- currentGear = '1';
- tft.pushImage(0, 0, 240, 240, epd_bitmap_1st_Gear_Run[inc]);
- inc++;
- if (inc >= 12){
- inc = 0;
- }
- delay(20);
- }
- else if (hallValue1 >= 1880 && hallValue1 <= 2050){
- currentGear = '2';
- tft.pushImage(0, 0, 240, 240, epd_bitmap_2nd_Gear_Run[inc]);
- inc++;
- if (inc >= 12){
- inc = 0;
- }
- delay(20);
- }
- else if ((hallValue0 >= 2200 && hallValue0 < 2285) && (hallValue3 >= 2300 && hallValue3 < 2700)){
- currentGear = '3';
- tft.pushImage(0, 0, 240, 240, epd_bitmap_3rd_Gear_Run[inc]);
- inc++;
- if (inc >= 12){
- inc = 0;
- }
- delay(20);
- }
- else if (hallValue1 >= 2120 && (hallValue2 >= 2000 && hallValue2 <= 2020)){
- currentGear = '4';
- tft.pushImage(0, 0, 240, 240, epd_bitmap_4th_Gear_Run[inc]);
- inc++;
- if (inc >= 12){
- inc = 0;
- }
- delay(20);
- }
- else if (hallValue3 >= 2700){
- currentGear = '5';
- tft.pushImage(0, 0, 240, 240, epd_bitmap_5th_Gear_Run[inc]);
- inc++;
- if (inc >= 12){
- inc = 0;
- }
- delay(20);
- }
- else if (hallValue2 <= 1910){
- currentGear = 'R';
- tft.pushImage(0, 0, 240, 240, epd_bitmap_Rev_Gear_Run[inc]);
- inc++;
- if (inc >= 12){
- inc = 0;
- }
- delay(20);
- }
- else {
- currentGear = 'N';
- tft.pushImage(0, 0, 240, 240, epd_bitmap_Neutral_Gear[0]);
- delay(20);
- }
- tft.drawNumber(hallValue0, 50, 50);
- tft.drawNumber(hallValue3, 150, 50);
- tft.drawNumber(hallValue1, 50, 150);
- tft.drawNumber(hallValue2, 150, 150);
- tft.drawChar(currentGear, 120, 120, 4);
- }
If I end up commenting out one of the bitmap arrays in the main loop, the program runs and says it's only using 47% of available memory, so uncommenting the bitmap array shouldn't use up all of the memory. Is it possible to increase the drom limit size, or does anyone know how to make a custom partition with working spiffs bigger than 3mb so I can just upload the bitmaps to SPIFFS instead. I'm also confused about why, if all of the bitmaps are being stored in PROGMEM flash, can I not use the full 16mb of flash. Any help is appreciated