xs-dev 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,8 +4,8 @@ exports.installDeps = void 0;
|
|
|
4
4
|
const exec_1 = require("../../system/exec");
|
|
5
5
|
// apt-get install git wget flex bison gperf python-is-python3 python3-pip python3-serial python-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util
|
|
6
6
|
async function installDeps(spinner) {
|
|
7
|
-
await (0, exec_1.execWithSudo)('apt-get install --yes git wget flex bison gperf python-is-python3 python3-pip python3-serial
|
|
7
|
+
await (0, exec_1.execWithSudo)('apt-get install --yes git wget flex bison gperf python-is-python3 python3-pip python3-serial python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util', { stdout: process.stdout });
|
|
8
8
|
spinner.succeed();
|
|
9
9
|
}
|
|
10
10
|
exports.installDeps = installDeps;
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGludXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvdG9vbGJveC9zZXR1cC9lc3AzMi9saW51eC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSw0Q0FBZ0Q7QUFFaEQsbUtBQW1LO0FBQzVKLEtBQUssVUFBVSxXQUFXLENBQy9CLE9BQXlDO0lBRXpDLE1BQU0sSUFBQSxtQkFBWSxFQUNoQix5S0FBeUssRUFDekssRUFBRSxNQUFNLEVBQUUsT0FBTyxDQUFDLE1BQU0sRUFBRSxDQUMzQixDQUFBO0lBQ0QsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFBO0FBQ25CLENBQUM7QUFSRCxrQ0FRQyJ9
|
|
@@ -7,7 +7,7 @@ description: Initialize a new project and start to interact with some hardware!
|
|
|
7
7
|
|
|
8
8
|
## Project creation
|
|
9
9
|
|
|
10
|
-
The [`init` command](/features/init) will create a new directory with the name provided and
|
|
10
|
+
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:
|
|
11
11
|
|
|
12
12
|
```
|
|
13
13
|
xs-dev init guiding-light
|
|
@@ -120,19 +120,19 @@ With that configured, the `main.js` file can be updated with the following code:
|
|
|
120
120
|
```javascript
|
|
121
121
|
const Digital = device.io.Digital;
|
|
122
122
|
const led = new Digital({
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
pin: device.pin.led,
|
|
124
|
+
mode: Digital.Output,
|
|
125
125
|
});
|
|
126
126
|
led.write(1);
|
|
127
127
|
|
|
128
128
|
let state = 0;
|
|
129
129
|
System.setInterval(() => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
led.write(state);
|
|
131
|
+
if (state === 0) {
|
|
132
|
+
state = 1;
|
|
133
|
+
} else {
|
|
134
|
+
state = 0;
|
|
135
|
+
}
|
|
136
136
|
}, 200);
|
|
137
137
|
```
|
|
138
138
|
|
|
@@ -141,8 +141,8 @@ Using the [global `device` variable](https://419.ecma-international.org/#-16-hos
|
|
|
141
141
|
```javascript
|
|
142
142
|
const Digital = device.io.Digital;
|
|
143
143
|
const led = new Digital({
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
pin: device.pin.led,
|
|
145
|
+
mode: Digital.Output,
|
|
146
146
|
});
|
|
147
147
|
led.write(1);
|
|
148
148
|
```
|
|
@@ -152,12 +152,12 @@ To make the light blink, the next value to be written is stored as the `state` v
|
|
|
152
152
|
```javascript
|
|
153
153
|
let state = 0;
|
|
154
154
|
System.setInterval(() => {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
155
|
+
led.write(state);
|
|
156
|
+
if (state === 0) {
|
|
157
|
+
state = 1;
|
|
158
|
+
} else {
|
|
159
|
+
state = 0;
|
|
160
|
+
}
|
|
161
161
|
}, 200);
|
|
162
162
|
```
|
|
163
163
|
|