You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the documentation may be wrong or the immediate flag is not working as documented. Currently, if I run this code:
sub = metawear
.publishWhenConnected()
.first()
.createTimedEvent(period: 2000, repetitions: 2, immediateFire: false, recordedEvent: {
let command: MWCommand = .led(.blue, .blink(repetitions: 3))
command.command(board: metawear.board)
})
.handleEvents(receiveOutput: { timer in
mbl_mw_timer_start(timer)
})
.sink(
receiveCompletion: { completion in
print("COMPLETED: \(completion)")
},
receiveValue: { value in
print("VALUE: ", value)
}
)
It runs as expected and the LED fires after 2 seconds. Yet, according to the docs, the immediateFire flag should negate the need to call mbl_mw_timer_start, however, if I run this:
sub = metawear
.publishWhenConnected()
.first()
.createTimedEvent(period: 2000, repetitions: 2, immediateFire: true, recordedEvent: {
let command: MWCommand = .led(.blue, .blink(repetitions: 3))
command.command(board: metawear.board)
})
.sink(
receiveCompletion: { completion in
print("COMPLETED: \(completion)")
},
receiveValue: { value in
print("VALUE: ", value)
}
)
Nothing happens and the timer does not seem to run the specified LED command.
Additionally, it would be nice if createTimedEvent worked similarly to recordEvents where command closure has the board as an argument.
The text was updated successfully, but these errors were encountered:
Hi,
I think the documentation may be wrong or the immediate flag is not working as documented. Currently, if I run this code:
It runs as expected and the LED fires after 2 seconds. Yet, according to the docs, the
immediateFire
flag should negate the need to callmbl_mw_timer_start
, however, if I run this:Nothing happens and the timer does not seem to run the specified LED command.
Additionally, it would be nice if
createTimedEvent
worked similarly torecordEvents
where command closure has the board as an argument.The text was updated successfully, but these errors were encountered: