Hello, I've an app for my arduino robot which is connected with hc-06 bluetooth module in App Inventor. When I click "forward" button, the function 'Call.BluetoothClient1.SendText.Text' block sends the text forward value to hc-06 bluetooth device. My robot takes one step forward.
Currently, my button looks like this
This is where I'm having a problem. I need a second button that gives forward text command for 2 to 3 seconds longer (or repeat the text). So, my robot can take multiple steps forward with only a button press. How can I make this button repeat it's command for 2 to 3 seconds?
I also have this "long button touch down" command, but it isn't what I wanted. I need a one click button to send "Forward" text for 2 or 3 seconds in one press only. (It is okay if a solution is to spam 'Forward' command.Help needed )
Consider renaming that COUNTER variable to STEPS_FORWARD_REMAINING, and have it count down to zero in a Clock Timer.
When you get the Long Click to request the repeating Forwards, set the counter to how many steps you want and start the Clock Timer that checks the counter, decrements it, and sends the F.
Now i have some ideas, how should i change my blocks, sir. Can you describe for me, I'm still a new learner in this platform and I am trying every block but I couldn't figured it out.
Here, I fixed it. This is my method to add a delay to the button command;
Explanation;
Button pressed, function is called and code output sends "F" letter to move forward,
This delay function sets 1000 ms
I added "the.call.delay" variable after button's text output, and copy-paste the same "F" letter output below it,
profit
Note; I can also add more text command outputs after delay variable in button block area as well, as much I want, (Example; Go forward for 5 seconds, wait, go forward or do somethıngs)