Examplefordifferent sending methods https://github.com/sui77/rc-switch/ */#include <RCSwitch.h>RCSwitch mySwitch = RCSwitch(); void setup() { Serial.begin(9600);//Transmitter is connected to Arduino Pin#10mySwitch.enableTransmit(10);//Optional set pulse length.//mySwitch.setPulseLength(3...
示例一:Example for receiving */ #include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); voidsetup() { Serial.begin(9600); mySwitch.enableReceive(0);// 接收器中断 0 => 即 pin #2 } voidloop() { if(mySwitch.available()) { output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitl...
示例一:Example for receiving */ #include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); void setup() { Serial.begin(9600); mySwitch.enableReceive(0); // 接收器中断 0 => 即 pin #2 } void loop() { if (mySwitch.available()) { output(mySwitch.getReceivedValue(), mySwitch.getReceiv...
示例一:Example for receiving */ #include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); void setup() { Serial.begin(9600); mySwitch.enableReceive(0); // 接收器中断 0 => 即 pin #2 } void loop() { if (mySwitch.available()) { output(mySwitch.getReceivedValue(), mySwitch.getReceiv...
示例一:Example for receiving */ #include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); void setup() { Serial.begin(9600); mySwitch.enableReceive(0); // 接收器中断 0 => 即 pin #2 } void loop() { if (mySwitch.available()) { ...
RCSwitch mySwitch = RCSwitch();void setup() {Serial.begin(9600);mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2//接2号口}void loop() {if (mySwitch.available()){int value = mySwitch.getReceivedValue();//读取并付值给valueif (value == 1){Serial.print(...
</*Simple example for sendinghttp://code.google.com/p/rc-switch/*/#include<RCSwitch.h>RCSwitchmySwitch=RCSwitch();void setup() {mySwitch.enableTransmit(2); // Using Pin #2}void loop() {mySwitch.send("1100101"); // Send the message 0x65, in ASCII, ‘a’delay(1000); // 1 se...
</*Simple example for sendinghttp://code.google.com/p/rc-switch/*/#include<RCSwitch.h>RCSwitch mySwitch=RCSwitch();voidsetup() { mySwitch.enableTransmit(2);//Using Pin #2}voidloop() { mySwitch.send("1100101");//Send the message 0x65, in ASCII, ‘a’delay(1000);//1 second del...
https://github.com/sui77/rc-switch/wiki Info Send RC codes Use your Arduino or Raspberry Pi to operate remote radio controlled devices. This will most likely work with all popular low cost power outlet sockets. If yours doesn't work, you might need to adjust the pulse length. All you ...
Switch (using RCSwitch (i.e. Radio Control Switch) - See 'ST_Anything_RCSwitch' example (Requires RCSwitch library, included in this repo) Servo Motor (using Capability Switch Level (0-99) to map to Motor Angles (0-180) - See the 'ST_Anything_Servos...' example sketch ...