Hello,
I'm working with my GPS project. At the moment, it's only test without gps, I'm sending random values from microcontroller to my device via bluetooth. Receiving works good, but I would like to save all the values of received signal in the array, but I can't do this. Array is empty all the time and I receive communicate from logs: "ArrayIsOutOfBoundException". I can't fix this.
It's my code (condensed a bit):
Maybe it's better way to do this, without an array, but I don't have idea.
Waiting for some tips.
Regards.
I'm working with my GPS project. At the moment, it's only test without gps, I'm sending random values from microcontroller to my device via bluetooth. Receiving works good, but I would like to save all the values of received signal in the array, but I can't do this. Array is empty all the time and I receive communicate from logs: "ArrayIsOutOfBoundException". I can't fix this.
It's my code (condensed a bit):
B4X:
Dim WspX() As Double
-----------
If Buffer.Length=5 Then
If Odebrane.StartsWith(Chr(104)) Then
If Odebrane.EndsWith(Chr(13)) Then
Try
k=k+1
Suwak2=Odebrane.SubString2(1,4)
Val3 = NumberFormat(Suwak2,3,0)
Val4 = Val3/250 'it's double
For i=0 To k
WspX(i)=Val4
Next
Log(WspX(i))
Xmin = Activity.Width/2
Catch
Log(LastException.Message)
End Try
End If
End If
Maybe it's better way to do this, without an array, but I don't have idea.
Waiting for some tips.
Regards.