I have a problem with wSensorLocID(8) string array.
Variable wSensorLocID(0) is displayed corectly only inside InitArrays sub after initilization Log("Wicc -> ". The variable in timer gets strange characters or provides error Exception (28) if i use onewire lib.
B4X:
Sub Process_Globals
Public Serial1 As Serial
Private timer1 As Timer
Private wSensorLocID(8) As String
Private wSensorVAL(8) As Double
Private wSensorTIMES(8) As Int
Private pin16 As Pin
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
timer1.Initialize("timer1_Tick", 2000)
timer1.Enabled = True
InitArrays
End Sub
Private Sub InitArrays
For wiic = 0 To wSensorLocID.Length -1
wSensorLocID(wiic) = "123"
wSensorTIMES(wiic) = 0
wSensorVAL(wiic) = 0
Next
Log("Wicc -> ", wSensorLocID(0)) <------- here the variable is displayed correctly
End Sub
Sub Timer1_Tick
Log("---1 ", wSensorLocID(0)) <------- here the variable is not displayed correctly
GetDevices
Log("---3 ", wSensorLocID(0)) <------- here the variable is not displayed correctly
End Sub
Private Sub GetDevices
Log("---2 ", " Counter " , wSensorLocID(0))
End Sub
Variable wSensorLocID(0) is displayed corectly only inside InitArrays sub after initilization Log("Wicc -> ". The variable in timer gets strange characters or provides error Exception (28) if i use onewire lib.
Last edited: