B4R Question question about RCSwitch

Cesar_Morisco

Active Member
Hey guys
I have a question about RCSwitch, I can't receive As
my string as "CMDA"
I don't know, that's right too
Could anyone tell me about this
I already thank you

B4R:
Sub Process_Globals
    Public Serial1 As Serial
    Private wifi As ESP8266WiFi
    Public Serial1 As Serial
    Private rcs As RCSwitch
    Private Pino As D1Pins
    
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Delay(1000)
    Log("AppStart")
    
    If wifi.Connect2("SSID", "PASSWORD") Then
        Log(wifi.LocalIp)
        rcs.Initialize
        rcs.enableReceive("rcs_Available",Pino.D2)
    Else
        Log("Failed to connect to network")
    End If
    
End Sub

private Sub rcs_Available()
    Log("Code: ", rcs.ReceivedValue)
    Log("Protocol: ", rcs.ReceivedProtocol)
    Log("Bit length: ", rcs.ReceivedBitlength)
    Log("Delay: ", rcs.ReceivedDelay)
    If rcs.ReceivedValue = "CMDA" Then
        Log("OI")
    End If
    rcs.ResetAvailable
End Sub
 

Attachments

  • transmissor-rf-433mhz-receptor-rf-com-chip-super-heterodino-antenas-stx882.jpg
    transmissor-rf-433mhz-receptor-rf-com-chip-super-heterodino-antenas-stx882.jpg
    116.7 KB · Views: 79
Top