Sub Process_Globals
Public Serial1 As Serial
Private Astream As AsyncStreams
Private LED13 As Pin
Private softserial As SoftwareSerial
Private Astream2 As AsyncStreams
Private bc As ByteConverter
End Sub
Private Sub AppStart
Serial1.Initialize(9600)
Log("AppStart")
LED13.Initialize(13, LED13.MODE_OUTPUT)
Astream.Initialize(Serial1.Stream, "Astream_NewData", "Astream_Error")
softserial.Initialize(57600, 10, 11)
Astream2.Initialize(softserial.Stream, "astream2_newdata", Null)
Astream2.Write("test".GetBytes)
End Sub
Sub Astream_NewData (Buffer() As Byte)
Astream2.Write("data from B4J: ".GetBytes)
Astream2.Write(bc.HexFromBytes(Buffer).GetBytes)
LED13.DigitalWrite(Buffer(0) = 1)
End Sub
Sub Astream2_NewData (Buffer() As Byte)
End Sub