Using the Arduino 101 ble2 example i have been sending data reliably; also i receive the millis in the custom list view on android. How do i get the data "millis" into a variable i can use. Stepping thru i see the millis field get filled; i cannot yet get the value in a variable.
when i press the read data button i get the millis displayed in the custom list view; how do you get that value in a variable i can use; i see it i just cannot use it
Sub DataAvailable (Service As String, Characteristics As Map)
pbReadData.Visible = False
clv.Add(CreateServiceItem(Service), 30dip, "")
For Each id As String In Characteristics.Keys
clv.Add(CreateCharacteristicItem(id, Characteristics.Get(id)), 40dip, "")
Next
End Sub
Can you post a screenshot of the screen with the data shown?
Sorry for not posting properly; do my best; not familiar with posting and I will make mistakes.
The code is the example; the b4a side; everything seems to be working. I seem unable to express my issue clearly.
In the picture on the bottom line of the clv you see a number; the millis sent from the Arduino. I would like to use that number; not just see it. When I step thru I see it come up on the bottom line on the picture (clv); have no idea where that millis number exists. How can I put that number (the millis ) in a text box by itself? Or place it in some type of variable. Or use it.
placed the code in Main dataAvailable;in Starter used ReadData2 to get one line on the clv and from the b4r side send constant "111111" see picture; get "111111" every time in clv and various hex numbers as I press repeatedly readdata button in the lable3 all preceded with B@; how can I get the "111111" in lable3 ?
Thank you for your help
B4X:
Sub DataAvailable (Service As String, Characteristics As Map)
pbReadData.Visible = False
clv.Add(CreateServiceItem(Service), 30dip, "")
For Each id As String In Characteristics.Keys
clv.Add(CreateCharacteristicItem(id, Characteristics.Get(id)), 40dip, "")
If Service = "00000001-0000-1000-8000-00805f9b34fb" Then
Dim millis As String = Characteristics.Get("00001001-0000-1000-8000-00805f9b34fb")
Label3.Text=millis
End If
Next
End Sub
Thank you; label3 shows "111111". I had tried hextostring thinking it was hex. I remember a tutorial on Bluetooth that discussed services and their characteristics; just cannot find it on your site again; there is so much great stuff.