File tree 2 files changed +10
-12
lines changed
2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -33,23 +33,22 @@ node eg/led.js
33
33
34
34
35
35
``` javascript
36
- var five = require (" johnny-five" );
37
- var board = new five. Board ();
36
+ const { Board , Led } = require (" johnny-five" );
37
+ const board = new Board ();
38
38
39
- board .on (" ready" , function () {
40
- var led = new five. Led (13 );
39
+ board .on (" ready" , function () {
40
+ const led = new Led (13 );
41
41
42
42
// This will grant access to the led instance
43
43
// from within the REPL that's created when
44
44
// running this program.
45
45
this .repl .inject ({
46
- led: led
46
+ led
47
47
});
48
48
49
49
led .blink ();
50
50
});
51
51
52
-
53
52
```
54
53
55
54
Original file line number Diff line number Diff line change 1
- var five = require ( "../lib/johnny-five.js" ) ;
2
- var board = new five . Board ( ) ;
1
+ const { Board , Led } = require ( "../lib/johnny-five.js" ) ;
2
+ const board = new Board ( ) ;
3
3
4
- board . on ( "ready" , function ( ) {
5
- var led = new five . Led ( 13 ) ;
4
+ board . on ( "ready" , function ( ) {
5
+ const led = new Led ( 13 ) ;
6
6
7
7
// This will grant access to the led instance
8
8
// from within the REPL that's created when
9
9
// running this program.
10
10
this . repl . inject ( {
11
- led : led
11
+ led
12
12
} ) ;
13
13
14
14
led . blink ( ) ;
15
15
} ) ;
16
-
17
16
/* @markdown
18
17
This script will make `led` available in the REPL, by default on pin 13.
19
18
Now you can try, e.g.:
You can’t perform that action at this time.
0 commit comments