T tzfpg Active Member Licensed User Longtime User Oct 30, 2018 #1 i using wemos mini hardware serial to receive data from another device, i can't receive any data. Code: Copy Sub Process_Globals 'These global variables will be declared once when the application starts. 'Public variables can be accessed from all modules. Public LogSerial As Serial Private SerialNative1 As Stream Private astreamData As AsyncStreams Dim bc As ByteConverter End Sub Code: Copy Private Sub AppStart LogSerial.Initialize(115200) RunNative("SerialNative1", Null) astreamData.Initialize(SerialNative1,"astreamData_NewData", Null) Log("AppStart") End Sub Code: Copy Sub astreamData_NewData (buffer() As Byte) Log(bc.HexFromBytes(buffer)) End Sub Code: Copy #IF C void SerialNative1(B4R::Object* unused) { ::Serial1.begin(9600,SERIAL_8N2); b4r_main::_serialnative1->wrappedStream = &::Serial1; } #END IF Above is my testing code, which part make the problem?
i using wemos mini hardware serial to receive data from another device, i can't receive any data. Code: Copy Sub Process_Globals 'These global variables will be declared once when the application starts. 'Public variables can be accessed from all modules. Public LogSerial As Serial Private SerialNative1 As Stream Private astreamData As AsyncStreams Dim bc As ByteConverter End Sub Code: Copy Private Sub AppStart LogSerial.Initialize(115200) RunNative("SerialNative1", Null) astreamData.Initialize(SerialNative1,"astreamData_NewData", Null) Log("AppStart") End Sub Code: Copy Sub astreamData_NewData (buffer() As Byte) Log(bc.HexFromBytes(buffer)) End Sub Code: Copy #IF C void SerialNative1(B4R::Object* unused) { ::Serial1.begin(9600,SERIAL_8N2); b4r_main::_serialnative1->wrappedStream = &::Serial1; } #END IF Above is my testing code, which part make the problem?
T tzfpg Active Member Licensed User Longtime User Oct 30, 2018 #2 i found the solution, change Serial1 to Serial. Upvote 0