Commit 581c60ee authored by Daniel STAN's avatar Daniel STAN

Proprification

parent 02b34e75
[submodule "IRrecv/rc-switch"]
path = arduino/libraries/RCSwitch
url = https://github.com/sui77/rc-switch.git
[submodule "arduino/libraries/IRLib"]
path = arduino/libraries/IRLib
url = https://github.com/cyborg5/IRLib.git
/* Example program for from IRLib – an Arduino library for infrared encoding and decoding
* Version 1.3 January 2014
* Copyright 2014 by Chris Young http://cyborg5.com
* Based on original example sketch for IRremuote library
* Version 0.11 September, 2009
* Copyright 2009 Ken Shirriff
* http://www.righto.com/
*/
/*
* IRLib: IRrecvDump - dump details of IR codes with IRrecv
* An IR detector/demodulator must be connected to the input RECV_PIN.
*/
/* Arduino directement connecté à kugel, pour communiquer
avec programme python coté port série*/
// Pin du recepteur Infrarouge
#define RECV_PIN 11
// Pin du rf
#define RF_PIN 10
#include <IRLib.h>
#include <RCSwitch.h>
int RECV_PIN = 11;
IRrecv My_Receiver(RECV_PIN);
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
// For ir-decoder
IRdecodeNEC My_Decoder;
unsigned int Buffer[RAWBUF];
int incomingByte = 0;
// Pour les relais. Canal et numéro de relai (port) sur lequel envoyer une
// commande. On indique également s'il faut allumer ou éteindre
int todo_channel = 4;
int todo_port = 1;
boolean todo_on = true;
......@@ -37,13 +34,14 @@ void setup()
My_Receiver.enableIRIn(); // Start the receiver
My_Decoder.UseExtnBuf(Buffer);
mySwitch.enableTransmit(10);
mySwitch.enableTransmit(RF_PIN);
}
void loop() {
int val;
int incomingByte = 0;
if (My_Receiver.GetResults(&My_Decoder)) {
//Restart the receiver so it can be capturing another code
//while we are working on decoding this one.
......@@ -77,16 +75,16 @@ void loop() {
case 0xfd50af:
Serial.println("Control: Next");
break;
case 16589023:
case 0xfd20df:
Serial.println("Control: Setup");
break;
case 16605343:
case 0xfd609f:
Serial.println("Control: Stop");
break;
case 16617583:
case 0xfd906f:
Serial.println("Control: Enter");
break;
case 16609423:
case 0xfd708f:
Serial.println("Control: Return");
break;
default:
......
Subproject commit 8d9c22c50df1901dcd310a8254788d19aaf6d2e4
Subproject commit bb3f142329d1be1adfd8ecc9a0b22ad2067cbc89
For information on installing libraries, see: http://arduino.cc/en/Guide/Libraries
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment