Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino IDE demo source code for KC868-AI]--#04-KC868-AI_RF receive_code
#1
[Arduino IDE demo source code for KC868-AI]--#04-KC868-AI_RF receive_code

Code:
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup()
{
  mySwitch.enableReceive(digitalPinToInterrupt(13));

  Serial.begin(115200);
  Serial.println();
}

 
void loop()
{
//-------------------------------------
  if (mySwitch.available()) {
   
    Serial.print("Received ");
    Serial.print( mySwitch.getReceivedValue() );
    Serial.print(" / ");
    Serial.print( mySwitch.getReceivedBitlength() );
    Serial.print("bit ");
    Serial.print("Protocol: ");
    Serial.println( mySwitch.getReceivedProtocol() );

    mySwitch.resetAvailable();
  }
  delay(30);
 
}


Attached Files
.zip   RF.zip (Size: 533 bytes / Downloads: 173)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)