удалила лишнее, протестировала

This commit is contained in:
klassents committed 2025-01-17 14:37:51 +07:00
1 parent d9946ff386
commit 3b26203ebb
10 files changed
+87 -277

No files matched your search

@@ -33,33 +33,28 @@
*/
#include <Arduino.h>
#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
#if FLASHEND <= 0x1FFF || (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF) // For 8k flash or 512 bytes RAM or less, like ATtiny85, ATtiny167
#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
#define EXCLUDE_EXOTIC_PROTOCOLS
//#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
/*
* 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
#include <IRremote.hpp>
#if defined(APPLICATION_PIN)
#define RELAY_PIN APPLICATION_PIN
#else
#define RELAY_PIN 5
#endif
#define RELAY_PIN 5
#define IR_RECEIVE_PIN 2
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(RELAY_PIN, OUTPUT);
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));
@@ -89,7 +84,6 @@ void loop() {
Serial.println(F("off"));
}
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604
IrReceiver.printIRResultShort(&Serial);
IrReceiver.printIRSendUsage(&Serial);
Serial.println();
@@ -98,11 +92,7 @@ void loop() {
Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
IrReceiver.printIRResultRawFormatted(&Serial, true);
}
#else
// Print a minimal summary of received data
IrReceiver.printIRResultMinimal(&Serial);
Serial.println();
#endif // FLASHEND
}
last = millis();
IrReceiver.resume(); // Enable receiving of the next value