Raspberry pi & Raspberry Pico 433MHZ: transmit, receive, relay

This commit is contained in:
2023-04-12 14:56:55 +08:00
parent d3f887d658
commit 295f4e8a66
40 changed files with 3493 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/*
Simple example for receiving
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
}
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();
}
}