float growth=10;
const int redPin=2;
const int greenPin=15;
void setup() {
// put your setup code here, to run once:
pinMode(redPin,OUTPUT);
pinMode(greenPin,OUTPUT);
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
if(growth<=1){
digitalWrite(redPin,HIGH);
digitalWrite(greenPin,LOW);
Serial.println("RED LED on");
}
if(growth>=10){
digitalWrite(redPin,LOW);
digitalWrite(greenPin,HIGH);
Serial.println("Green LED on");
}
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}