Bluetooth and long press

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.

Hi there,
This is the part of my code for long press:

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 :slight_smile:

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 :slight_smile:

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.

1 Like

I have written in this topic the solution of @Taifun and @ABG.

1 Like