Hi there, tried this method with bluetooh connection and long press doesn't work, any ideas or other options?
In my case button sends text data to bluetooth module.
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
please describe, what you are trying to do
currently you are sending the text d only once and every second the counter increments until you release the button
Taifun
The idea in my code:
When the button is pressed the text d should be sent every second (or faster) until the button is released
then you should move the SendText block into the Clock.Timer event
Taifun
Is there any other options for long press?
Because i use more buttons and need more timers, and they interferes with each other.....
Really thankful for all the help
You don't need more timers, just an extra global variable called What_To_Send, initially blank.
Have each button set that global variable to whatever that button wants to send, and clear it to blank when released.
Have your one clock timer check if the global What_To_Send is blank. If blank, don't send anything, else send it.