-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
45 lines (45 loc) · 984 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// var Gpio = require('onoff').Gpio,
// red = new Gpio(17, 'out'),
// green = new Gpio(22, 'out'),
// blue = new Gpio(27, 'out');
//
// function exit() {
// red.unexport();
// green.unexport();
// blue.unexport();
// process.exit();
// }
//
// function turn(light, value, forTime) {
// forTime = forTime || 5000;
// setTimeout(function() {
// light.writeSync(value);
// }, forTime);
// }
//
// function turnOn(light, forTime) {
// turn(light, 1, forTime);
// }
//
// function turnOff(light, forTime) {
// turn(light, 0, forTime);
// }
//
// function turnOnAndOff(light, forTime) {
// forTime = forTime || 5000;
// setTimeout(function() {
// light.writeSync(1);
// setTimeout(function() {
// light.writeSync(0);
// }, forTime);
// }, forTime);
// }
//
// turnOnAndOff(red, 2000);
// turnOnAndOff(blue, 1000);
// turnOnAndOff(green, 4000);
//
// // turnOff(green);
// // turnOff(blue);
// // turnOff(red);
// setTimeout(exit, 15000);