|
楼主 |
发表于 2019-9-6 10:49:39
|
显示全部楼层
- /*
- 【Arduino】108种传感器模块系列实验(资料+代码+图形+仿真)
- 实验一百零七: 2262/2272四路无线遥控套件M4非锁接收板 配四键无线遥控器模组
- 安装库:IDE-工具-管理库-搜索RCSwitch-安装
- 示例一:Example for receiving
- */
- #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()) {
- output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
- mySwitch.resetAvailable();
- }
- }
复制代码 |
|