Smart Home Automation Forum

Full Version: [arduino code examples for MT4]-01 433MHz RF receiver
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Code:
/*
  Simple example for receiving
 
  https://github.com/sui77/rc-switch/
*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(digitalPinToInterrupt(38));
  Serial.print("begin test");
}

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();
  }
}
[attachment=10189]
arduino ino file download:
[attachment=10191]
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:
[attachment=10190]