B4R Question Serial log problem

Discussion in 'B4R Questions' started by tzfpg, Oct 30, 2018.

  1. tzfpg

    tzfpg Member Licensed User

    i using wemos mini hardware serial to receive data from another device, i can't receive any data.

    Code:
    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:
    Private Sub AppStart
        LogSerial.Initialize(
    115200)
        RunNative(
    "SerialNative1"Null)
        astreamData.Initialize(SerialNative1,
    "astreamData_NewData"Null)
        
    Log("AppStart")
    End Sub
    Code:
    Sub astreamData_NewData (buffer() As Byte)
        
    Log(bc.HexFromBytes(buffer))
    End Sub
    Code:
    #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?
     
  2. tzfpg

    tzfpg Member Licensed User

    i found the solution, change Serial1 to Serial.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice