Skip to content
Discussion options

You must be logged in to vote

remote.light.on and hub.ble.broadcast both use Bluetooth. When both are called at the same time, you'll see this resource cannot be used in two tasks at once.

You could resolve it as follows:

  • Instead of calling hub.ble.broadcast directly, instead set a variable such as broadcast_data to your desired value.
  • Instead of calling remote.light.on directly, instead set a variable such as remote_color to your desired value.
  • In a new parallel task, do the following in a loop:
    • if broadcast_data does not equal old_broadcast_data (depending on your data, perhaps check equality by element)
      • then broadcast(broadcast_data)
      • set old_broadcast_data equal to broadcast_data
    • if remote_color does not equal o…

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
2 replies
@zus2
Comment options

@dlech
Comment options

Comment options

You must be logged in to vote
1 reply
@dlech
Comment options

Comment options

You must be logged in to vote
1 reply
@dlech
Comment options

Comment options

You must be logged in to vote
4 replies
@laurensvalk
Comment options

Answer selected by zus2
@zus2
Comment options

@laurensvalk
Comment options

@zus2
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants