15Views0Replies

Author Options:

Which code? Answered

In this lesson, you state "In this code, the LED does not light up in direct response to the button press, but rather in response to a message being received by the Adafruit IO feed "command". " Which code are you referring to? If it is the code directly above this line:

int command = data->toInt();

if (command == 1){ //light up the LED
Serial.print("received <- ");
Serial.println(command);
digitalWrite(LED_PIN, HIGH);
delay(500);
digitalWrite(LED_PIN, LOW);
} else {
Serial.print("received <- ");
Serial.println(command);
}

this code does not compile. Can you please clear up my confusion? Thank you.

Discussions