-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Original bug posted in 2019: #1520
I'm also seeing this issue with a very simple approach using setTimeouts.
Code to reproduce:
const board = new Board({
port: 'COM3',
})
board.on('ready', () => {
const moistureSensor = new Sensor({
pin: 'A0',
freq: 100,
})
moistureSensor.on('data', value => {
console.log(value)
})
setTimeout(() => {
console.log('Disable')
moistureSensor.disable()
}, 1000)
setTimeout(() => {
console.log('Enable')
moistureSensor.enable()
}, 2000)
setTimeout(() => {
console.log('Disable')
moistureSensor.disable()
}, 3000)
})
Console:
413
413
413
413
413
413
413
413
413
Disable
Enable
413
413
413
413
413
413
413
413
413
Disable
413
414
[.... Keeps logging forever until program is exited]
Metadata
Metadata
Assignees
Labels
No labels