Hey there
@tysonlt
Thank you a lot for your very fast response. I really tried my best but guess i am really CPP stupid. I just dont get it.
Maby it is not that hard to understand, but i am thinking in another way (the old way)
The code you gave is not tested as you have say'd... it gives me the same errors i am getting for hours now (x not declared etc... C++ forbidden to use etc...)
Hope you can or want to help me out:
i would only need 10 presets and 8 scenes to declare and reuse each time.. ( in the future, if i understand some more i can declare and instantiate the effects and effect states myself (that is my goal
)
My VB
This is what i would do in VB to declare, instantiate and than reuse the variable. I really dont understand this in the C++
Declaring the preset as a variable:
dim
myPresetNumber1, myPresetNumber2, myPresetNumber3 as integer
dim
myPresetName1, myPresetName3, myPresetName3 as string
dim
mySceneNumber1, mySceneNumber2, mySceneNumber3 as integer
dim
mySceneName1, mySceneName2, mySceneName3 as string
etc.
Instantiate the variable:
my variable: (C++ AxeSystem)
myPresetNumber1 = ((Preset(1).number))
myPresetName1 = ((Preset(1).name))
mySceneNumber1 = ((Scene(1).number))
mySceneName1 = ((Scene(1).name))
Reuse a variable in my code for the screens i would use it like this:
:if using layout presets. --> screen 1-10 (CS1-CS10)
Why do i want to declare variables and reuse them:
I try to do it this way, so that all the variables are allready known and ready to use when i am setting the value to the screens.
This way, the 15 screens would only take 1 second to be created and shown instead of beeing created one by one (doesn't look and feel right).
digitalWrite (CS1, LOW);
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(3);
tft.setCursor(10,0);
tft.println("Preset");
tft.setTextSize(3);
tft.setCursor(110,0);
tft.setTextColor(ST7735_WHITE);
tft.println(
myPresetNumber1);
tft.setCursor(10,60);
tft.setTextSize(3);
tft.setTextColor(ST7735_WHITE);
tft.println(
myPresetName1);
digitalWrite (CS1, HIGH);
etc: --> CS2, CS3
:if using layout for scenes --> Screen 1-4 and 6-9 (CS1-CS4 and CS6-CS9)
digitalWrite (CS1, LOW);
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(3);
tft.setCursor(10,0);
tft.println("Scene:");
tft.setTextSize(3);
tft.setCursor(30,50);
tft.setTextColor(ST7735_WHITE);
tft.println(
mySceneNumber1);
tft.setCursor(75,85);
tft.setTextSize(3);
tft.setTextColor(ST7735_WHITE);
tft.println(
mySceneName1);
digitalWrite (CS1, HIGH);
etc: --> CS2, CS3
> The AxeFx has 511 presets.
BANKS up or DOWN for preset layout: (+10 or -10 function)
In my configuration this would lead to make a configuration for BANK A - F
each bank would have 10 numbers ( 0-9)
Preset:
000-009 would be BANK A0
010-019 would be BANK A1
100-109 would be BANK B0
330-339 would be BANK C3
510-511 would be BANK F1
The Banknumbers would tell me which presetnumbers to collect and set to myPresetNumber1, myPresetNumber2 etc.
currentPresetNumber would tell me what the current bank it is... that way i know what bank i want to select if i go BANK-UP or BANK-DOWN and get the info.
How it would work: (preset 028)
First number of the activePreset.number is 0, that is Bank A
Second number is 2,
Now i know i am in Bank A2
BANK-UP would be To A3
BANK-DOWN would be to A1
(BANK A1 to F2 or visa versa is not figgured out yet)
It is not your problem that i don't understand the C++. If you have the time, hope you want to help me out to understand.
I have visited many C++ and Arduino forums, but all are way off the AxeFx library. This is as close as i can get to try to learn.
Thank you in advance
Cheers