mirror of
https://github.com/filiprojek/auto-awning-close.git
synced 2025-02-20 01:52:58 +01:00
update
This commit is contained in:
50
main/receiver/receiver.ino
Normal file
50
main/receiver/receiver.ino
Normal file
@@ -0,0 +1,50 @@
|
||||
#include <RCSwitch.h>
|
||||
|
||||
RCSwitch mySwitch = RCSwitch();
|
||||
|
||||
int delayTime = 2000;
|
||||
|
||||
|
||||
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() ); */
|
||||
|
||||
switch(mySwitch.getReceivedValue())
|
||||
{
|
||||
case 16736113:
|
||||
Serial.println("aaaaaaaaaa");
|
||||
delay(delayTime);
|
||||
break;
|
||||
case 3696136:
|
||||
Serial.println("bbbbbbbbbb");
|
||||
delay(delayTime);
|
||||
break;
|
||||
case 16736120:
|
||||
Serial.println("cccccccccc");
|
||||
delay(delayTime);
|
||||
break;
|
||||
case 16736114:
|
||||
Serial.println("dddddddddd");
|
||||
delay(delayTime);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
mySwitch.resetAvailable();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user