-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathportab-off.js
More file actions
30 lines (23 loc) · 723 Bytes
/
Copy pathportab-off.js
File metadata and controls
30 lines (23 loc) · 723 Bytes
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
// jxmot - this file is only meant to demonstrate that
// it's possible to turn the ports(A & B) off.
'use strict';
// Import the interface to Tessel hardware
const tessel = require('tessel');
// jxmot - turn off ports A and B, not in use so turn off
// the LEDs
tessel.close();
// Turn one of user the LEDs on to start.
tessel.led[2].on();
// Blink! This will alternate between the 2 user
// LEDs (green and blue).
setInterval(() => {
tessel.led[2].toggle();
tessel.led[3].toggle();
}, 500);
console.log("I'm blinking! (Press CTRL + C to stop)");
process.on('SIGINT', () => {
console.log('\nCaught interrupt signal, exiting...\n');
tessel.led[2].off();
tessel.led[3].off();
process.exit();
});