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