3.2
This commit is contained in:
parent
f16ccbeaa6
commit
582c05cdc3
@ -46,16 +46,16 @@ module.exports = {
|
|||||||
pins.forEach(async (pin) => {
|
pins.forEach(async (pin) => {
|
||||||
switch (pin.mode) {
|
switch (pin.mode) {
|
||||||
case 'OUT':
|
case 'OUT':
|
||||||
togglePin(pin.board, err => {
|
this.togglePin(pin.board, err => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
});
|
});
|
||||||
// Wait 1000ms before toggling again.
|
// Wait 1000ms before toggling again.
|
||||||
setTimeout(togglePin(pin.board, err => {
|
setTimeout(this.togglePin(pin.board, err => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
}), 1000);
|
}), 1000);
|
||||||
break;
|
break;
|
||||||
case 'IN':
|
case 'IN':
|
||||||
sensePin(pin.board, (state, err) => {
|
this.sensePin(pin.board, (state, err) => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
console.log(`${pin.key} state: ${state}`);
|
console.log(`${pin.key} state: ${state}`);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user