Android Question AStream_NewData Byte in Int

red30

Active Member
Licensed User
B4X:
Sub AStream_NewData (Buffer() As Byte)
  
    For i = 0 To Buffer.Length-1
        New123(j)=Buffer(i)
        j=j+1
        If j = 2 Then
            j=0
            Sig=Bit.Or(Bit.ShiftLeft(New123(1),8),New123(0))
            Graf
        End If
    Next
End Sub
I send from the microtrollet an array of values 1,2,3,4 ... 4095. And I get: 1,2,3...125,126,127,-128,-127,-126...-3,-2,-1,256,257,258...381,382,383,-128,-127,-126...-3,-2,-1,512,513,514 and so on! I can not understand why this is happening? How to fix it? With sending, everything is fine, I checked 0 ... 4095 several times.
 
Last edited:
Top