From 0b21426f71a8d0ae08b9706be09be116ac9cdda8 Mon Sep 17 00:00:00 2001 From: Forairaaaaa Date: Wed, 15 Apr 2026 14:05:18 +0800 Subject: [PATCH] fix serial build error --- examples/IR/Receive/Receive.ino | 20 ++++++++++---------- examples/IR/Send/Send.ino | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/IR/Receive/Receive.ino b/examples/IR/Receive/Receive.ino index 1ad7e62..e6c451d 100644 --- a/examples/IR/Receive/Receive.ino +++ b/examples/IR/Receive/Receive.ino @@ -35,7 +35,7 @@ decode_results results; void setup() { M5StackChan.begin(); - USBSerial.begin(115200); + Serial.begin(115200); // Perform a low level sanity checks that the compiler performs bit field // packing as we expect and Endianness is as we expect. @@ -55,23 +55,23 @@ void loop() if (irrecv.decode(&results)) { // Display a crude timestamp. uint32_t now = millis(); - USBSerial.printf(D_STR_TIMESTAMP " : %06u.%03u\n", now / 1000, now % 1000); + Serial.printf(D_STR_TIMESTAMP " : %06u.%03u\n", now / 1000, now % 1000); // Check if we got an IR message that was to big for our capture buffer. - if (results.overflow) USBSerial.printf(D_WARN_BUFFERFULL "\n", kCaptureBufferSize); + if (results.overflow) Serial.printf(D_WARN_BUFFERFULL "\n", kCaptureBufferSize); // Display the library version the message was captured with. - USBSerial.println(D_STR_LIBRARY " : v" _IRREMOTEESP8266_VERSION_STR "\n"); + Serial.println(D_STR_LIBRARY " : v" _IRREMOTEESP8266_VERSION_STR "\n"); // Display the tolerance percentage if it has been change from the default. - if (kTolerancePercentage != kTolerance) USBSerial.printf(D_STR_TOLERANCE " : %d%%\n", kTolerancePercentage); + if (kTolerancePercentage != kTolerance) Serial.printf(D_STR_TOLERANCE " : %d%%\n", kTolerancePercentage); // Display the basic output of what we found. - USBSerial.print(resultToHumanReadableBasic(&results)); + Serial.print(resultToHumanReadableBasic(&results)); // Display any extra A/C info if we have it. String description = IRAcUtils::resultAcToString(&results); - if (description.length()) USBSerial.println(D_STR_MESGDESC ": " + description); + if (description.length()) Serial.println(D_STR_MESGDESC ": " + description); yield(); // Feed the WDT as the text output can take a while to print. // Output the results as source code - USBSerial.println(resultToSourceCode(&results)); - USBSerial.println(); // Blank line between entries - yield(); // Feed the WDT (again) + Serial.println(resultToSourceCode(&results)); + Serial.println(); // Blank line between entries + yield(); // Feed the WDT (again) } delay(50); } diff --git a/examples/IR/Send/Send.ino b/examples/IR/Send/Send.ino index 0e7a4a8..4086646 100644 --- a/examples/IR/Send/Send.ino +++ b/examples/IR/Send/Send.ino @@ -26,22 +26,22 @@ uint8_t samsungState[kSamsungAcStateLength] = {0x02, 0x92, 0x0F, 0x00, 0x00, 0x0 void setup() { M5StackChan.begin(); - USBSerial.begin(115200); + Serial.begin(115200); irsend.begin(); } void loop() { - USBSerial.println("NEC"); + Serial.println("NEC"); irsend.sendNEC(0x00FFE01FUL); delay(2000); - USBSerial.println("Sony"); + Serial.println("Sony"); irsend.sendSony(0xa90, 12, 2); // 12 bits & 2 repeats delay(2000); - USBSerial.println("a rawData capture from IRrecvDumpV2"); + Serial.println("a rawData capture from IRrecvDumpV2"); irsend.sendRaw(rawData, 67, 38); // Send a raw data capture at 38kHz. delay(2000); - USBSerial.println("a Samsung A/C state from IRrecvDumpV2"); + Serial.println("a Samsung A/C state from IRrecvDumpV2"); irsend.sendSamsungAC(samsungState); delay(2000); }