Like to work with tabs, get an error: variable or field 'DrawInfo' declared void #3232
Unanswered
Blaubart
asked this question in
Q&A - General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I tried to move this code from the main tab to its own tab:
`//***********************************
//**** Draw ValueBoxes and Data ****
//***********************************
void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) {
fontOfName.loadFont("micross15");
fontOfName.createSprite(spriteNameWidth, 25);
fontOfName.setTextColor(color, BLACK);
fontOfName.fillSprite(BLACK);
fontOfName.fillSprite(TFT_BLACK);
fontOfName.setTextSize(2);
fontOfName.setTextDatum(TR_DATUM);
fontOfName.drawString(spriteName, spriteNameWidth, 2);
fontOfName.pushToSprite(&background, x, y, TFT_BLACK);
fontOfName.deleteSprite();
fontOfName.unloadFont();
if (infoType == "small") {
fontOfName.loadFont("micross30");
}
else {
fontOfName.loadFont("micross50");
}
fontOfName.createSprite(spriteValueWidth, spriteValueHight);
fontOfName.setTextColor(color, BLACK);
fontOfName.fillSprite(BLACK);
fontOfName.fillSprite(TFT_BLACK);
fontOfName.setTextSize(3);
fontOfName.setTextDatum(TR_DATUM);
fontOfName.drawString(value, spriteValueWidth, 2);
fontOfName.pushToSprite(&background, x + spriteNameWidth, y, TFT_BLACK);
fontOfName.deleteSprite();
fontOfName.createSprite(spriteunitWidth + 5, 25);
fontOfName.setTextColor(color, BLACK);
fontOfName.fillSprite(BLACK);
fontOfName.fillSprite(TFT_BLACK);
fontOfName.setTextSize(3);
fontOfName.setTextDatum(TR_DATUM);
fontOfName.drawString(unit, spriteunitWidth, 2);
fontOfName.pushToSprite(&background, x + spriteNameWidth + spriteValueWidth, y, TFT_BLACK);
fontOfName.deleteSprite();
fontOfName.unloadFont();
}`
My error message:
DrawData:4:15: error: variable or field 'DrawInfo' declared void void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~~~~~~~~~ DrawData:4:15: error: 'TFT_eSprite' was not declared in this scope DrawData:4:48: error: expected primary-expression before 'color' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~~~ DrawData:4:62: error: expected primary-expression before 'infoType' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~~~~~~ DrawData:4:79: error: expected primary-expression before 'spriteName' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~~~~~~~~ DrawData:4:98: error: expected primary-expression before 'value' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~~~ DrawData:4:112: error: expected primary-expression before 'unit' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~~ DrawData:4:118: error: expected primary-expression before 'int' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~ DrawData:4:139: error: expected primary-expression before 'int' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~ DrawData:4:161: error: expected primary-expression before 'int' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~ DrawData:4:183: error: expected primary-expression before 'int' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~ DrawData:4:204: error: expected primary-expression before 'int' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~ DrawData:4:211: error: expected primary-expression before 'int' void DrawInfo(TFT_eSprite fontOfName, uint32_t color, String infoType, String spriteName, String value, String unit, int spriteNameWidth, int spriteValueHight, int spriteValueWidth, int spriteunitWidth, int x, int y) { ^~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino: In function 'void ValueRefresh(void*)': DisplayRefresh:148:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "Wind", "", "", 36, 25, 0, 0, 105, 45); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:148:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "Wind", "", "", 36, 25, 0, 0, 105, 45); ^~~~~~~~ DrawMenu DisplayRefresh:155:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, GREEN, "small", "", valueCwsAsString, "", 0, 25, 30, 0, 140, 40); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:155:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, GREEN, "small", "", valueCwsAsString, "", 0, 25, 30, 0, 140, 40); ^~~~~~~~ DrawMenu DisplayRefresh:166:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, BLUE, "small", "", valueAwsAsString, "", 0, 25, 30, 0, 176, 40); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:166:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, BLUE, "small", "", valueAwsAsString, "", 0, 25, 30, 0, 176, 40); ^~~~~~~~ DrawMenu DisplayRefresh:183:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "large", "Avg.", valueVaaAsString, "", 34, 40, 94, 0, 88, 84 + offset); //+1 ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:183:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "large", "Avg.", valueVaaAsString, "", 34, 40, 94, 0, 88, 84 + offset); //+1 ^~~~~~~~ DrawMenu DisplayRefresh:193:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "large", "Net.", valueVanAsString, "", 34, 40, 94, 0, 88, 84 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:193:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "large", "Net.", valueVanAsString, "", 34, 40, 94, 0, 88, 84 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:210:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", nameSpeed, valueSpeed, "km/h", 28, 25, 57, 68, 63, 136 + offset); //+18 ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:210:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", nameSpeed, valueSpeed, "km/h", 28, 25, 57, 68, 63, 136 + offset); //+18 ^~~~~~~~ DrawMenu DisplayRefresh:213:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", nameSpeed, valueSpeed, "km/h", 28, 25, 57, 68, 63, 136 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:213:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", nameSpeed, valueSpeed, "km/h", 28, 25, 57, 68, 63, 136 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:231:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", nameHight, valueHight, "m", 31, 25, 74, 29, 82, 173 + offset); //+12 ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:231:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", nameHight, valueHight, "m", 31, 25, 74, 29, 82, 173 + offset); //+12 ^~~~~~~~ DrawMenu DisplayRefresh:234:9: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", nameHight, valueHight, "m", 31, 25, 74, 29, 82, 173 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:234:9: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", nameHight, valueHight, "m", 31, 25, 74, 29, 82, 173 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:254:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", "MC", valueSetting, "m/s", 24, 25, 56, 53, 83, 210 + offset); //+6 ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:254:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", "MC", valueSetting, "m/s", 24, 25, 56, 53, 83, 210 + offset); //+6 ^~~~~~~~ DrawMenu DisplayRefresh:257:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "MC", valueSetting, "m/s", 24, 25, 56, 53, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:257:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "MC", valueSetting, "m/s", 24, 25, 56, 53, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:269:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", "QNH", valueSetting, "", 50, 25, 82, 1, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:269:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", "QNH", valueSetting, "", 50, 25, 82, 1, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:272:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "QNH", valueSetting, "", 50, 25, 82, 1, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:272:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "QNH", valueSetting, "", 50, 25, 82, 1, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:284:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", "Bug", valueSetting, "%", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:284:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", "Bug", valueSetting, "%", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:287:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "Bug", valueSetting, "%", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:287:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "Bug", valueSetting, "%", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:299:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", "ATT", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:299:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", "ATT", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:302:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "ATT", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:302:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "ATT", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:314:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", "Mute", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:314:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", "Mute", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:317:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "Mute", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:317:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "Mute", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:329:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, RED, "small", "Wind", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:329:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, RED, "small", "Wind", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:332:11: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "Wind", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:332:11: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "Wind", valueSetting, "", 39, 25, 63, 31, 83, 210 + offset); ^~~~~~~~ DrawMenu DisplayRefresh:342:7: error: 'DrawInfo' was not declared in this scope DrawInfo(nameOfField, WHITE, "small", "Mode", stf_mode, "", 41, 25, 70, 0, 105, 248); ^~~~~~~~ /Users/User/Proj/Device/e-Vario/Software/FreeVarioGauge/DisplayRefresh.ino:342:7: note: suggested alternative: 'DrawMenu' DrawInfo(nameOfField, WHITE, "small", "Mode", stf_mode, "", 41, 25, 70, 0, 105, 248); ^~~~~~~~ DrawMenu Mehrere Bibliotheken wurden für "WiFi.h" gefunden Benutzt: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/WiFi Nicht benutzt: /Applications/Arduino.app/Contents/Java/libraries/WiFi Bibliothek Streaming in Version 6.1.1 im Ordner: /Users/User/Documents/Arduino/libraries/Streaming wird verwendet Bibliothek WiFi in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/WiFi wird verwendet Bibliothek WebServer in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/WebServer wird verwendet Bibliothek EEPROM in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM wird verwendet Bibliothek ESPmDNS in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/ESPmDNS wird verwendet Bibliothek Update in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Update wird verwendet Bibliothek SPI in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/SPI wird verwendet Bibliothek TFT_eSPI in Version 2.5.0 im Ordner: /Users/User/Documents/Arduino/libraries/TFT_eSPI wird verwendet Bibliothek FS in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/FS wird verwendet Bibliothek SPIFFS in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/SPIFFS wird verwendet Bibliothek Preferences in Version 2.0.0 im Ordner: /Users/User/Library/Arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/Preferences wird verwendet Bibliothek ESP32Encoder in Version 0.10.1 im Ordner: /Users/User/Documents/Arduino/libraries/ESP32Encoder wird verwendet exit status 1 variable or field 'DrawInfo' declared void
I don't have so much experience with tabs, ans TFT_eSPI, so I have no idea what I did wrong. Hope someone could help.
Beta Was this translation helpful? Give feedback.
All reactions