// https://forum.arduino.cc/t/function-running-when-it-shouldnt/1237583
// https://wokwi.com/projects/392878392548727809

void setup() {
  Serial.begin(115200);
  Serial.println("Jello Whirled!\n");
}

bool sentHot;
bool sentCold;
bool sentNormal;

# define TOO_HOT    768
# define TOO_COLD   256

void loop() {
  int temperature = analogRead(A0);

  if (temperature > TOO_HOT) {
    if (!sentHot) {
      Serial.println("Too hot.");
      sentHot = true;
      sentCold = false;
      sentNormal = false;
    }
  }
  else if (temperature < TOO_COLD) {
    if (!sentCold) {
      Serial.println("Too cold.");
      sentCold = true;
      sentHot = false;
      sentNormal = false;
    }
  }
  else {
    if (!sentNormal) {
      Serial.println("Temperature normal.");
      sentNormal = true;
    }
  }
//  delay(777);  // until it works
}