Shop OBEX P1 Docs P2 Docs Learn Events
C code for IR request — Parallax Forums

C code for IR request

RsadeikaRsadeika Posts: 3,837
edited 2015-11-25 22:41 in Propeller 1
I just looked in the Simple Libraries and the Learn site, did not find any code that deals with using the IR. I know the Learn site deals mostly with the Activity Board, which does not have any IR components, but the QuickStart Board (QS), using the HIB add on does. Also I would like to look at some "pure" examples as opposed to Spin code -> spin2cpp -> C, method. Maybe this is asking to much?

I am still interested in having the Hackable Badge talk to the QS + HIB combo, using the IR component, seems like a good test to do of the two boards. So, does any body have any pure C code for IR? The other possibility is trying to extract the IR code from the Badge library, way to complex of a job. It would have been nice if there was an IR library made that could be used in other programs, like working with the QS+HIB combo.

Thanks

Ray

Comments

  • Are you looking for C code that lets you do two way communications with IR or just receiving IR code from an IR remote? I have several projects decoding NEC code remotes for bot control and interacting with an RTC. None of these originated in Spin, just written in Simpleide C by me.
  • Thanks Hal, I am looking for two way communication between the Hackable Badge and QS+HIB combo. The code would be used on the QS+HIB combo side, the Hackable Badge has its own IR library. There is a SIRC Library in the Simple Libraries collection, but no IR library (two way communication).

    Ray
  • Doing serial over IR is easy and you should be able to modify one of the serial libraries without any problems. In fact, the only portion that needs to be modified is the transmit section: set one of the counters for your desired modulation frequency and when you want to transmit a start bit or 0, enable the modulated transmit pin via the dira register. Easy peasy.
  • Thanks Jon for your general overview of how it can be done, yep, easy peasy. I was hoping to get the attention of Parallax on this one so they could make an official function that could be added to the C library that works with the QS+HIB combo.

    Ray
  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-11-28 01:06
    What? A library should work on any propeller platform, right? So get on it -- you ask for a lot of code, how about contributing? The key I shared above -- controlling the DIRA bit instead of the OUTA bit -- ensures that it will work with circuits that drive the LED from either side. I know because I've done this in Spin many times. In the early days of the badge development I only had one, so I used a QS+HID to send test information of IR to a badge.

    Sorry for the rant; I will not darken another one of your threads with my "Put on your big-boy pants and do it yourself" mentality.
  • Thanks Jon.

    Ray
Sign In or Register to comment.