Avatar for dsample

dsample

Member since Jan 2014 • Last active Dec 2021
  • 2 conversations
  • 4 comments

I'm a Software Engineer & Architect with experience of telecom networks and web development. I have a collection of various Arduino, Trinket and Espruino boards, although haven't done a lot with them yet. I have several Raspberry Pis with the most notable being a Node-RED 'thing' controller system for the other 'IoT' devices around my home, including my heating controls.

Most recent activity

    • 2 comments
    • 1,034 views
  • in JavaScript
    Avatar for dsample

    I've got some original Espruino boards from the first Kickstarter, and it's been a while since I've looked at them. Is there a way to view the code which is already on them?

    • 8 comments
    • 3,421 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for dsample

    @Gordon you're right, that does increase the range significantly! Thanks.

    It's not far enough to have the button sitting on the arm of a chair to control both devices, but it'll do for pointing at each device in turn and clicking the button to turn it off.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for dsample

    I'm trying to make a fairly simple button which will turn both my TV and AV receiver off. This will help both myself and my wife make the quick transition from watching some TV to heading up to bed when our baby daughter starts crying.

    I've posted the code below, and after some experimentation with waiting between IR signals, I've got something working, but I have to hold the Puck really close to the devices for it to work. Is there some way to boost the IR signal (brightness of the IR LED?) or is it really for 'close range' connections?

    Gordon's examples of IR usually show his cheap IR lamp, but a lamp would usually be placed some distance from any button you'd want to control with, so although it's a visual example, it may be a bit contrived if it can't actually reach across a reasonable size room. I'm only trying to go about 2m (one through a glass door and have only managed to get it working successfully from about 20cm.

    var pronto = require ('pronto');
    
    var tvOff = pronto.decode('0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689'); // Samsung discrete Power Off
    
    var avOff = pronto.decode('0000 006c 0022 0002 0156 00ac 0016 0016 0016 0040 0016 0016 0016 0016 0016 0040 0016 0016 0016 0040 0016 0040 0016 0016 0016 0016 0016 0040 0016 0040 0016 0016 0016 0040 0016 0040 0016 0016 0016 0040 0016 0040 0016 0040 0016 0016 0016 0016 0016 0016 0016 0040 0016 0016 0016 0016 0016 0016 0016 0016 0016 0040 0016 0040 0016 0040 0016 0016 0016 0040 0016 05cc 0156 0055 0016 0e5d'); // Onkyo discrete Power Off
    
    var waitBetweenSignals = 250;
    
    var sendIRSignals = function(signals) {
      console.log('Sending IR');
      Puck.IR(signals.shift());
      if (signals.length > 0) {
        setTimeout(sendIRSignals, waitBetweenSignals, signals);
      }
    };
    
    var turnOff = function() {
      console.log('Turning off');
      sendIRSignals([tvOff, avOff]);
    };
    
Actions