UNPKG
bot-io
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
0.1.1
0.1.0
ADC, GPIO, PWM, UARTs, and more on the BeagleBone Black.
github.com/fivdi/bot-io
fivdi/bot-io
bot-io
/
test
/
button-lightswitch.js
12 lines
(8 loc)
•
206 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
'use strict'
;
var
bot =
require
(
'../'
), button =
new
bot.
Button
(bot.
pins
.
p9_23
), led =
new
bot.
Led
(bot.
pins
.
p9_26
), ledState =
0
; button.
on
(
'pressed'
,
function
(
) { led.
value
(ledState ^=
1
); });