Skip to content

Commit

Permalink
Update first-project.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zsarge authored Sep 17, 2024
1 parent e83aa20 commit f486c2e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions docs/getting-started/first-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@ Then, you can add this:
const int pin = LED_BUILTIN;

void setup() {
> Serial.begin(115200);
+ Serial.begin(115200);
pinMode(pin, OUTPUT);
}

bool state = HIGH;

void loop() {
digitalWrite(pin, state);
< state = !state;
< delay(1000);
> Serial.print("The pin state is: ");
> Serial.println(state);
>
> String input = Serial.readStringUntil('\n');
> Serial.print("recieved: ");
> Serial.println(input);
>
> if (input.equals("on")) {
> state = HIGH;
> } else if (input.equals("off")) {
> state = LOW;
> }
- state = !state;
- delay(1000);
+ Serial.print("The pin state is: ");
+ Serial.println(state);
+
+ String input = Serial.readStringUntil('\n');
+ Serial.print("recieved: ");
+ Serial.println(input);
+
+ if (input.equals("on")) {
+ state = HIGH;
+ } else if (input.equals("off")) {
+ state = LOW;
+ }
}
```

Expand Down

0 comments on commit f486c2e

Please sign in to comment.