Hello! I'm wondering why I'm having this Error Compiling Message: "error: 'standby' was not declared in this scope" in function void.
I declare "standby" in setup function:
Serial.begin(9600);
Serial.println("Choose your standby Power:");
while(Serial.available()==0){
//TFT definitions
screen.stroke(0, 0, 0);
screen.setTextSize(2);
screen.text("Go to \n Serial Port", 12, 40); //Texto -7 nos yy
}
screen.background(204,229, 255);
float serialPower=Serial.parseFloat();
float standby=serialPower*graphHeight/11500;
(graphHeight is declared before the setup function)
In funtion void loop():
void loop() {
//other instructions here...
screen.stroke(0, 250, 0); //GREEN
screen.line(xPos, blueDownLineY-standby, xPos, blueDownLineY);
As before I do not have problems with undeclared things (I declared them all!!)... I just don't know if we can declare something to read on setup() and then use that value in loop() function...