Skip to content

Commit

Permalink
docs: Fix typo and format code blocks consistently (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Oct 13, 2023
1 parent ce37cf8 commit d210bcb
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions docs/src/content/docs/guide/02-blinky.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Initialize a new project and start to interact with some hardware!

## Project creation

The [`init` command](/features/init) will create a new directory with the name provided and saffold the starting files based on a template or example:
The [`init` command](/features/init) will create a new directory with the name provided and scaffold the starting files based on a template or example:

```
xs-dev init guiding-light
Expand Down Expand Up @@ -120,19 +120,19 @@ With that configured, the `main.js` file can be updated with the following code:
```javascript
const Digital = device.io.Digital;
const led = new Digital({
pin: device.pin.led,
mode: Digital.Output,
pin: device.pin.led,
mode: Digital.Output,
});
led.write(1);

let state = 0;
System.setInterval(() => {
led.write(state);
if (state === 0) {
state = 1;
} else {
state = 0;
}
led.write(state);
if (state === 0) {
state = 1;
} else {
state = 0;
}
}, 200);
```

Expand All @@ -141,8 +141,8 @@ Using the [global `device` variable](https://419.ecma-international.org/#-16-hos
```javascript
const Digital = device.io.Digital;
const led = new Digital({
pin: device.pin.led,
mode: Digital.Output,
pin: device.pin.led,
mode: Digital.Output,
});
led.write(1);
```
Expand All @@ -152,12 +152,12 @@ To make the light blink, the next value to be written is stored as the `state` v
```javascript
let state = 0;
System.setInterval(() => {
led.write(state);
if (state === 0) {
state = 1;
} else {
state = 0;
}
led.write(state);
if (state === 0) {
state = 1;
} else {
state = 0;
}
}, 200);
```

Expand Down

0 comments on commit d210bcb

Please sign in to comment.