Avatar for pete

pete

Member since Mar 2014 • Last active Apr 2014
  • 1 conversations
  • 3 comments

Most recent activity

  • in Projects
    Avatar for pete

    Hi Gordon,

    Thanks for your response. So I racked my brain and tried a bunch of different approaches. I think I made some progress.

    First, I noticed that the tutorial measures the length of the gap between pulses and I thought that was curious. Ie, why not the length of the pulses themselves?, particularly, because IRReceiver module seems to allow both. So I coded this up: http://pastie.org/8997007 and measured the lengths of both and saw that both the pulse gaps and pulse lengths were not consistent across a button press. Then I went back to the documentation that I linked to above and saw that command length was around 82ms. My code in the pastie above puts a line break after 82ms has been reached and I noticed a pattern.

    First, the command is repeated, which I learned is a common pattern after reading Adafruits tutorial(http://learn.adafruit.com/ir-sensor/over­view)

    Then, I had the thought to divide the length of each output by the bit length of ~2ms. Depending on whether it was rising or falling dictated whether the output was a logic 1 or logic 0. By doing this, I get the binary specified in the documentation for each button. Which is awesome, because now I'm getting somewhere.

    So now I just have to create a driver to output this binary in pulse length and pulse gap lengths and I should be in business. We'll see... I have to take a break now and will report my results later.

  • in Projects
    Avatar for pete

    I just discovered this tutorial for my exact remote, but written for arduino. I've tried porting it to javascript but its not working. Presumably due to the fact that javascript doesn't have "sleep" and so the timing is probably all off. Also, the bit-wise operation is probably not correct.

    here is my port: http://pastie.org/8981359

  • in Projects
    Avatar for pete

    Hey everyone,

    I'm just getting started with espruino here. My first project is to make the lights in my room(which are currently controlled via an IR remote) controllable by the espruino.

    I have all the gear here: an espruino, an IR sensor, and an IR led. I followed the tutorial for decoding the IR signal from the remote, but I don't get a single number long number. The output is something like:

    0
    9
    9
    4
    

    or

    0
    1
    0
    1
    

    depending on the function on the remote.

    Here is what the raw times are:

    0.006740570068359375
    0.006732940673828125
    0.011264801025390625
    0.0067386627197265625
    0.00673198699951171875
    0.011066436767578125
    0.0067157745361328125
    0.0067081451416015625
    0.0112285614013671875
    0.0067043304443359375
    0.0067081451416015625
    0.01103115081787109375
    0.00671100616455078125
    0.00670528411865234375
    0.01123523712158203125
    0.006710052490234375
    0.00670337677001953125
    

    So as per the tutorial saying there are two distinct groups of numbers, it looks like my numbers split off at 0.01, so I changed it to that in the code.

    So I'm unclear if I have the correct numbers or not? Also, I'm unclear on what the next steps are to lighting the IR led programmatically. Specifically, I'm not sure how to connect the IR Led to the espruino as well as how to send the proper code to it programmatically.

    The remote is a Lutron MIR-ITFS 5 function remote. I actually found the datasheet for the remote: http://www.lutron.com/TechnicalDocumentL­ibrary/048158.doc if that helps anyone understand this problem a bit better

    Thanks in advance for any help continuing on here! :)

Actions