Добавлена библиотека IRremote #10
@ -44,8 +44,8 @@
|
||||
|
||||
#include <IRremote.hpp>
|
||||
|
||||
#define RELAY_PIN 5
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define RELAY_PIN 5 // P0_4
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
void setup() {
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
|
||||
//#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
|
||||
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define TONE_PIN 3
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
#define TONE_PIN 5 // P0_2
|
||||
|
||||
// Some kind of auto detect library if USE_TINY_IR_RECEIVER is deactivated
|
||||
#if !defined(USE_TINY_IR_RECEIVER)
|
||||
@ -119,11 +119,9 @@ void setup() {
|
||||
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing IRMP library version " VERSION_IRMP));
|
||||
#endif
|
||||
|
||||
#if !defined(ESP8266) && !defined(NRF5)
|
||||
// play feedback tone before setup, since it kills the IR timer settings
|
||||
tone(TONE_PIN, 1000, 50);
|
||||
delay(50);
|
||||
#endif
|
||||
|
||||
IRDispatcher.init(); // This just calls irmp_init()
|
||||
#if defined(USE_TINY_IR_RECEIVER)
|
||||
|
||||
@ -87,8 +87,11 @@
|
||||
|
||||
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
|
||||
|
||||
#define IR_RECEIVE_PIN 4
|
||||
#define IR_SEND_PIN 3
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
#define IR_SEND_PIN 3 // P0_0
|
||||
|
||||
int SEND_BUTTON_PIN = BTN_BUILTIN;
|
||||
int BTN_ACTIVE_STATE = LOW; // HIGH for Elbear boards, LOW for start board
|
||||
|
||||
/*
|
||||
* Helper macro for getting a macro definition as string
|
||||
@ -100,9 +103,6 @@
|
||||
|
||||
#include <IRremote.hpp>
|
||||
|
||||
int SEND_BUTTON_PIN = BTN_BUILTIN;
|
||||
int BTN_ACTIVE_STATE = HIGH;
|
||||
|
||||
int DELAY_BETWEEN_REPEAT = 50;
|
||||
|
||||
// Storage for the recorded code
|
||||
|
||||
@ -47,12 +47,13 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
#if !defined(IR_SEND_PIN)
|
||||
#define IR_SEND_PIN 3
|
||||
#define IR_SEND_PIN 3 // P0_0
|
||||
#endif
|
||||
|
||||
#define IR_RECEIVE_PIN 4
|
||||
|
||||
#define BTN_ACTIVE_STATE HIGH
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
#define SEND_BUTTON_PIN BTN_BUILTIN
|
||||
#define BTN_ACTIVE_STATE HIGH // HIGH for Elbear boards, LOW for Start board
|
||||
|
||||
/*
|
||||
* Helper macro for getting a macro definition as string
|
||||
@ -81,8 +82,6 @@
|
||||
|
||||
#include <IRremote.hpp>
|
||||
|
||||
#define SEND_BUTTON_PIN BTN_BUILTIN
|
||||
|
||||
#define DELAY_BETWEEN_REPEATS_MILLIS 70
|
||||
|
||||
// Storage for the recorded code, pre-filled with NEC data
|
||||
@ -106,7 +105,7 @@ void setup() {
|
||||
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
|
||||
Serial.println(F("Ready to receive pulse distance/width coded IR signals at pin " STR(IR_RECEIVE_PIN)));
|
||||
|
||||
IrSender.begin(); // Start with IR_SEND_PIN -which is defined in PinDefinitionsAndMore.h- as send pin and enable feedback LED at default feedback LED pin
|
||||
IrSender.begin(); // Start with IR_SEND_PIN as send pin and enable feedback LED at default feedback LED pin
|
||||
Serial.print(F("Ready to send IR signals at pin " STR(IR_SEND_PIN) " on press of button at pin "));
|
||||
Serial.println(SEND_BUTTON_PIN);
|
||||
}
|
||||
@ -184,6 +183,7 @@ void loop() {
|
||||
}
|
||||
}
|
||||
IrReceiver.resume(); // resume receiver
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
sSendButtonWasActive = tSendButtonIsActive;
|
||||
|
||||
@ -83,7 +83,7 @@
|
||||
#define STR_HELPER(x) #x
|
||||
#define STR(x) STR_HELPER(x)
|
||||
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
|
||||
void handleOverflow();
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
#define STR(x) STR_HELPER(x)
|
||||
#endif
|
||||
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
|
||||
#if !defined(RAW_BUFFER_LENGTH)
|
||||
|
||||
@ -94,9 +94,9 @@
|
||||
#define DECODE_SAMSUNG
|
||||
#define ADDRESS_OF_SAMSUNG_REMOTE 0x07 // The value you see as address in printIRResultShort()
|
||||
|
||||
#define TONE_PIN 8
|
||||
#define IR_RECEIVE_PIN 4
|
||||
#define IR_SEND_PIN 3
|
||||
#define TONE_PIN 5 // P0_2
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
#define IR_SEND_PIN 3 // P0_0
|
||||
|
||||
/*
|
||||
* Helper macro for getting a macro definition as string
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
/*
|
||||
* Helper macro for getting a macro definition as string
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
#define STR(x) STR_HELPER(x)
|
||||
#endif
|
||||
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
#define STR(x) STR_HELPER(x)
|
||||
#endif
|
||||
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
#define STR(x) STR_HELPER(x)
|
||||
#endif
|
||||
|
||||
#define IR_RECEIVE_PIN 2
|
||||
#define IR_RECEIVE_PIN 4 // P0_1
|
||||
|
||||
/*
|
||||
* For callback
|
||||
|
||||
Loading…
Reference in New Issue
Block a user