Hallo,
vielleicht hilft es dem TO das auf die Sprünge.
Danach wie schon wno158 schreibt Zeile für Zeile durchgehen warum das so ist wie es ist.
uint16_t FREQUENCY;
void setup()
{
Serial.begin(9600);
}
void loop()
{
for (FREQUENCY = 45 ; FREQUENCY <= 55 ; FREQUENCY++)
{
Serial.print(F("Frequency++: "));
Serial.println(FREQUENCY);
if (FREQUENCY <= 55)
{
for (FREQUENCY = 55; FREQUENCY <= 45 ; FREQUENCY--)
{
Serial.print(F("Frequency--: "));
Serial.println(FREQUENCY);
}
}
delay (2000);
}
}
Lese nochmal im Buch nach was im Schleifenkopf alles passiert ... bzw. gehe nochmal einen Schritt zurück. Nimm den if Block raus und schaue was passiert. Überlege warum das so ist wie es ist.