Delay before send 2 different data via bluetooth

Hi to all.
i need your help about delays in app inventor (never used them before in 3-4 small projects i made so far)

So i have one app that connects to a bluetooth (esp32 microcontroller)
from my app i want to change some values in the eeprom of the microcontroller.

my app works like this :

  1. connect to bluetooth
  2. switch on the parameter edit
  3. change the value from the slider
  4. press send button to send the value to microcontroller
  5. press save to store the value to the eeprom
  6. switch off the parameter edit
    until here is something that i have done it and work fine..

i wanted to make it so when someone press the save button then the the switch goes off and not to have to make one more step to switch it off as in my original app

The problem is that when i press the save button i send a special number to the microcontroller that when it reads it know that have to save the previous value to the eeprom and with switch off command i am sending an other special value to the microcontroller to raise a flag to my program.

so when i make the mobile app to switch off the edit at the same time i press save the app sends the 2 numbers as one... no delay between them and so my code in the microcontroller not working
so i thought to interval a delay between the 2 functions

i found a delay example but it didnt work for me (i am not sure if i embedded right )

here is a small example how i made my app with just one edit button (have to connect to a bluetooth to enable switch button)
delay.aia (4.6 KB)

thanks in advance

Use a clock timer, and transfer the blocks after your "wait" to the clock timer event.

Why don't you send the data with any character at the end. And in esp32 you just need to read up to this character.

Your missing event:

component_event

(I leave it to you to fill it in)

.Thanks for the help... you make me understand what i was doing wrong.

expect the missing block of the timer i have to mention for future readers that the settings for the clock must be all unchecked ( no "TimerAlwaysFires" and no " TimerEnabled" )