Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Fix inverted IR logic on the Non-plus Stick C
Browse files Browse the repository at this point in the history
  • Loading branch information
n0xa committed Oct 8, 2023
1 parent 379e106 commit 14b55df
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions m5stick-nemo.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Nemo Firmware for the M5 Stack Stick C Plus
// github.com/n0xa | IG: @4x0nn
#define PLUS
#if defined(PLUS)
#include <M5StickCPlus.h>
#define BIG_TEXT 4
Expand Down Expand Up @@ -469,17 +468,24 @@ void sendAllCodes()
for (uint8_t k = 0; k < numpairs; k++) {
uint16_t ti;
ti = (read_bits(bitcompression)) * 2;
offtime = powerCode->times[ti]; // read word 1 - ontime
ontime = powerCode->times[ti + 1]; // read word 2 - offtime
#if defined(PLUS)
offtime = powerCode->times[ti]; // read word 1 - ontime
ontime = powerCode->times[ti + 1]; // read word 2 - offtime
#else
ontime = powerCode->times[ti]; // read word 1 - ontime
offtime = powerCode->times[ti + 1]; // read word 2 - offtime
#endif
M5.Lcd.setTextSize(TINY_TEXT);
M5.Lcd.printf("rti = %d Pair = %d, %d\n", ti >> 1, ontime, offtime);
rawData[k * 2] = offtime * 10;
rawData[(k * 2) + 1] = ontime * 10;
yield();
}
irsend.sendRaw(rawData, (numpairs * 2) , freq);
// Hack: Set IRLED high to turn it off after each burst. Otherwise it stays on (active low)
digitalWrite(IRLED, HIGH);
#if defined(PLUS)
// Hack: Set IRLED high to turn it off after each burst. Otherwise it stays on (active low)
digitalWrite(IRLED, HIGH);
#endif
yield();
bitsleft_r = 0;
delay_ten_us(20500);
Expand Down

0 comments on commit 14b55df

Please sign in to comment.