удалила лишнее из примеров
This commit is contained in:
1 parent
2889721109
commit
8a0cc3dded
13 files changed
+145
-772
No files matched your search
+13
-10
@@ -94,7 +94,18 @@
|
||||
#define DECODE_SAMSUNG
|
||||
#define ADDRESS_OF_SAMSUNG_REMOTE 0x07 // The value you see as address in printIRResultShort()
|
||||
|
||||
#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
|
||||
#define TONE_PIN 8
|
||||
#define IR_RECEIVE_PIN 4
|
||||
#define IR_SEND_PIN 3
|
||||
|
||||
/*
|
||||
* 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>
|
||||
|
||||
void sendSamsungSmartHubMacro(bool aDoSelect);
|
||||
@@ -103,14 +114,10 @@ void IRSendWithDelay(uint8_t aCommand, uint16_t aDelayMillis);
|
||||
void setup() {
|
||||
pinMode(LED_BUILTIN, 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));
|
||||
|
||||
@@ -193,9 +200,7 @@ void sendSamsungSmartHubMacro(bool aDoSelect) {
|
||||
tWaitTimeAfterBoot = INITIAL_WAIT_TIME_SMARTHUB_READY_MILLIS;
|
||||
}
|
||||
|
||||
#if !defined(ESP32) // ESP32 uses another timer for tone(), so the receiver must not be stopped and restarted for it
|
||||
IrReceiver.stopTimer();
|
||||
#endif
|
||||
if (millis() < tWaitTimeAfterBoot) {
|
||||
// division by 1000 and printing requires much (8%) program memory
|
||||
Serial.print(F("It is "));
|
||||
@@ -221,9 +226,7 @@ void sendSamsungSmartHubMacro(bool aDoSelect) {
|
||||
tone(TONE_PIN, 2200, 200);
|
||||
delay(200);
|
||||
|
||||
#if !defined(ESP32)
|
||||
IrReceiver.restartTimer(); // Restart IR timer.
|
||||
#endif
|
||||
|
||||
Serial.println(F("Wait for \"not supported\" to disappear"));
|
||||
delay(2000);
|
||||
|
||||
Reference in new issue
Block a user