Skip to content

Commit 9403021

Browse files
committed
fix comments on spaceship example
The comments explaining the if..else part were mistaken.
1 parent 9c7e3ab commit 9403021

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/shared/examples/10.StarterKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ void loop(){
4444
switchstate = digitalRead(2);
4545

4646
// if the button is not pressed
47-
// blink the red LEDs
47+
// turn on the green LED and off the red LEDs
4848
if (switchstate == LOW) {
4949
digitalWrite(3, HIGH); // turn the green LED on pin 3 on
5050
digitalWrite(4, LOW); // turn the red LED on pin 4 off
5151
digitalWrite(5, LOW); // turn the red LED on pin 5 off
5252
}
5353
// this else is part of the above if() statement.
5454
// if the switch is not LOW (the button is pressed)
55-
// the code below will run
55+
// turn off the green LED and blink alternatively the red LEDs
5656
else {
5757
digitalWrite(3, LOW); // turn the green LED on pin 3 off
5858
digitalWrite(4, LOW); // turn the red LED on pin 4 off

0 commit comments

Comments
 (0)