Hi. Please help me i don`t understand how this works.
I`m trying to send this data for example from one arduino to another via RF24L01 with rRF24 library.
SERVER:
CLIENT:
I`m having "Out of bounds error. Array length = 1, Index = 1"
If i do "Log(b(0),b(1))" then it works but i have the result in bytes, so the second number since is that large, would be "124" or something like that ( don`t remember).
Basically i have 2 numbers ( a number can be larger than 9999) i want to send that data via RF24L01 and receive the numbers and asign them to Int.
I also tried via B4Rserializator( i dont know if this method is supported)
SEND:
RECEIVE:
I`m having "Out of bounds error. "
I would like to know something that works even if i`m sending string or other types (HEX etc).
Sorry but i`m not really good with bytes to X conversion and stuff.
Thank you.
I`m trying to send this data for example from one arduino to another via RF24L01 with rRF24 library.
SERVER:
B4X:
Dim b() As Byte = Array As Byte(14, 5500)
raf.WriteBytes(b, 0, b.Length, 0)
rf24.Write(buffer)
B4X:
Sub rf24_NewData (Data() As Byte)
raf2.Initialize(Data, True)
Dim b() As Byte = raf2.ReadBytes2(2, raf2.CurrentPosition)
Dim i() As Int=bc.IntsFromBytes(b)
Log(i(0),i(1))
End Sub
If i do "Log(b(0),b(1))" then it works but i have the result in bytes, so the second number since is that large, would be "124" or something like that ( don`t remember).
Basically i have 2 numbers ( a number can be larger than 9999) i want to send that data via RF24L01 and receive the numbers and asign them to Int.
I also tried via B4Rserializator( i dont know if this method is supported)
SEND:
B4X:
Dim obj() As Object=Array(22,8888)
rf24.Write(ser.ConvertArrayToBytes(obj))
B4X:
Sub rf24_NewData (Data() As Byte)
Dim be(10) As Object
Dim data() As Object = ser.ConvertBytesToArray(Data, be)
If data.Length = 0 Then Return
Dim nrOne As Object= data(0)
Dim nrTwo As Object = data(1)
Log(nrOne,NrTwo)
End Sub
I`m having "Out of bounds error. "
I would like to know something that works even if i`m sending string or other types (HEX etc).
Sorry but i`m not really good with bytes to X conversion and stuff.
Thank you.