Android Question Timer_Tick issue

Danny Marom

Member
Licensed User
Longtime User
Hi All

I am, most probably doing something stupid as I an totally new to Basic.

See attached project, It is based on the Arduino Bluetooth sample.

See the last three functions in Main.

VolageCal_FocusChanged and Transmit_Click work perfectly and the data reached my HC06 based hardware.

Trying the same code from the MainTimer_Tick generates the error in the Jpg.


Thanking you
Danny
 

Attachments

  • B4A.zip
    76.6 KB · Views: 302
  • PoolTIME Error Mag.jpg
    PoolTIME Error Mag.jpg
    240.6 KB · Views: 276

stevel05

Expert
Licensed User
Longtime User
Try moving the MainTime.Enabled = True to Activity_Resume. (I can't test it here). It may be calling the update before the device is initialized.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If that doesn't work you will need to make sure the device is connected before sending the message (in Starter), which is probably a better option anyway.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Alternatively you could start the timer from your SetState sub in Main once it is connected.
 
Upvote 0

Danny Marom

Member
Licensed User
Longtime User
Hi Steve
Thank you kindly. This was the problem. I delayed the communication by a second after the connection and it works.
Danny
 
Upvote 0
Top