IR Remote library that works with 0 and 1 series? #784
Replies: 4 comments 3 replies
-
Not a complete answer, but I think it's pretty close. This library: https://github.com/Arduino-IRremote/Arduino-IRremote knows about megatiny's, but not the 1614 specifically. So, most of the work done supporting the timers (timerA at least) is already done. I was able to compile the simple receiver example for a 1616, which is darn close to a 1614. Playing around with some #defines should get you there. There's a few bits in here that control which timer to use, depending on the architecture: https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.hpp Seems to specifically call out a few chips:
I suspect there's a better identifier to use that is a bit more generic. Would be good idea to raise it as an issue, because otherwise, the library looks handy. |
Beta Was this translation helpful? Give feedback.
-
You can test for megatinycore with #if defined(MEGATINYCORE), test the series of parts with #if (MEGATINYCORE_SERIES== ... ) which should be needed if you're fixing the library (Thank you kindly if that's what you're doing, get the bloody fix PR'ed in) Test for MILLIS_USE_TIMERA0, MILLIS_USE_TIMERD0, etc to see which timer they're using for millis. Defaults to TCA0 on 0-series so that there's one free type B timer, allowing tone() or any other timer requiring thing, TCD0, on the 1-series (on the logic that that timer a byzantine horror show - albeit an extremely powerful one - that nobody who cared about their own sanity would touch it with a 39.5 foot pole - so mad props to the library author! And 2-series defaults TCB1 because got ripped off and don't have the type D timer (I know why - it's because they only appeared in the 1-series to test out for Dx-series.). (And basic props to anyone who knows where the 39.5 foot pole line came from - it's a lyric from a song associated with a classic book and movie, but few have committed that jeremiad to memory. Its got some good, if nonspecific, zingers, and a lot of infantile ones, but best of all it works with my first name in place of the villian's name (keeping the Mr. which precedes it). Though I think most of the insults better fit timer D than they do me.) start of offtopic and at times very controversial rambling That was all of course before, by demonstrating that competence at the guitar wasn't required for success, Nirvana ruined music (certainly everything from the USA), which only began to recover two decades after his murder; I'm thankful for Ms. Love prematurely ending his career and impressed she got away with it since it's so bloody obvious how that went down - though of course such a severely botched investigation that lets a murderer off is always unsetting, if she didn't do him in, he could have lasted until the fent scourge dropped him with an OD (and with that kind of habit you know it would have) so we could have still been 15 years away from musicians experimenting with learning to play guitar before they got on stage. And by then I'd be too old for metal shows. I didn't mind nirvana's music, he had lyrical and compositional finesse that his contemporaries didn't copy, but i detest what he did to music. Before him, a lead guitarist in a rock or metal band could be counted on to know how to shred at least passably. Not so after him, and really what's the point of listening to a song if there's not at least one killer solo in there? Preferably a minisolo elsewhere in the song too or some epic twin guitar action, or solos where a kb and guitar trade off like CoB did so brilliantly (RIP - Resurrect in Power. Alcohol is poison; I didn't drink before he passed away either but now not only do I not care forit, I hold a personal grudge). Good example is their cover of Don't Stop at the Top, Those two were so good it takes a bunch of listens to pinpoint where exactly they switch off in the solo, though you hear it the first time through that they were doing so). But we're getting of topic aren't we....? Where were we? back on topic
That should should figure out a non-stupid timer to use. But I can also see having to do a number of copies with different names that will prefer different timers because of the inability to propagate preprocessor directives to the library, which is in a different compilation unit. And IMHO, don't bother supporting that other tinyCore, he lost the war with megaTinyCore. I moved fast once he had effectively declared himself to be a threat, and by the time he fortified one part of his core against my assaults I'd rolled a battalion of tanks into two others. I mean, I originally offered to to collaborate, and support the (strictly worse) pinmappings his hardware was selling as first class citizens of megaTinyCore, but he rebuked me shrug. I don't like competition with my cores; I take it very personally. And that's why I strive to make sure mine are always the best. And if war was what he wanted, war was what he'd get. And he lost. I burned his towns, looted his cities and sowed his fields with salt - he fled, and stopped developing. In these times only those who have lost their way venture into the ruins of tinycore. So you've just gotta cover DxCore and megaTinyCore (which are extremely similar - they share an incredible amount of code), and MegaCoreX (where you can count on millis always using TCB2 because he doesn't give users a menu to select the timer for millis- i think it's safe to just use TCB1 all the time on that one. |
Beta Was this translation helpful? Give feedback.
-
Maybe this is too late for you, but if you are interested only in reading the NEC protocol, this may help. It does not use timers explicitly, instead it uses an external interrupt. https://forum.arduino.cc/t/lightweight-arduino-ir-library-for-nec-remote-control-devices/595247 |
Beta Was this translation helpful? Give feedback.
-
I would think that an IR-Remote library could be made insanely super efficient on a modern AVR. It's it like.... an XX kHz carrier, modulated by data at some much slower data rate? As in the kind of task that makes the CCL logic blocks climb out of the chip and line up begging you to use them? |
Beta Was this translation helpful? Give feedback.
-
I've developed a product around the 1614 and figured hooking up a receiver for a NEC remote would be trivial but there appears to be no compatible libraries. Can anyone point me towards one?
Beta Was this translation helpful? Give feedback.
All reactions