удалила лишнее из примеров
This commit is contained in:
1 parent
2889721109
commit
8a0cc3dded
13 files changed
+145
-772
No files matched your search
+16
-13
@@ -46,23 +46,30 @@
|
||||
*/
|
||||
#include <Arduino.h>
|
||||
|
||||
#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
|
||||
#if !defined(IR_SEND_PIN)
|
||||
#define IR_SEND_PIN 3
|
||||
#endif
|
||||
|
||||
#define IR_RECEIVE_PIN 4
|
||||
|
||||
#define BTN_ACTIVE_STATE HIGH
|
||||
|
||||
/*
|
||||
* Helper macro for getting a macro definition as string
|
||||
*/
|
||||
#if !defined(STR_HELPER)
|
||||
#define STR_HELPER(x) #x
|
||||
#define STR(x) STR_HELPER(x)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Specify DistanceWidthProtocol for decoding. This must be done before the #include <IRremote.hpp>
|
||||
*/
|
||||
#define DECODE_DISTANCE_WIDTH // Universal decoder for pulse distance width protocols
|
||||
//
|
||||
#if !defined(RAW_BUFFER_LENGTH)
|
||||
// For air condition remotes it requires 750. Default is 200.
|
||||
# if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
|
||||
#define RAW_BUFFER_LENGTH 360
|
||||
# elif (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
|
||||
#define RAW_BUFFER_LENGTH 750
|
||||
# endif
|
||||
#endif
|
||||
|
||||
//#define NO_LED_FEEDBACK_CODE // saves 92 bytes program memory
|
||||
@@ -74,7 +81,7 @@
|
||||
|
||||
#include <IRremote.hpp>
|
||||
|
||||
#define SEND_BUTTON_PIN APPLICATION_PIN
|
||||
#define SEND_BUTTON_PIN BTN_BUILTIN
|
||||
|
||||
#define DELAY_BETWEEN_REPEATS_MILLIS 70
|
||||
|
||||
@@ -88,14 +95,10 @@ bool sSendButtonWasActive;
|
||||
void setup() {
|
||||
pinMode(SEND_BUTTON_PIN, INPUT_PULLUP);
|
||||
|
||||
Serial.begin(115200);
|
||||
Serial.begin(9600);
|
||||
while (!Serial)
|
||||
; // Wait for Serial to become available. Is optimized away for some cores.
|
||||
|
||||
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|
||||
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
|
||||
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
|
||||
#endif
|
||||
// Just to know which program is running on my Arduino
|
||||
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
|
||||
|
||||
@@ -111,7 +114,7 @@ void setup() {
|
||||
void loop() {
|
||||
|
||||
// If button pressed, send the code.
|
||||
bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == LOW); // Button pin is active LOW
|
||||
bool tSendButtonIsActive = (digitalRead(SEND_BUTTON_PIN) == BTN_ACTIVE_STATE);
|
||||
|
||||
/*
|
||||
* Check for current button state
|
||||
|
||||
Reference in new issue
Block a user