Avatar for user104751

user104751

Member since Nov 2019 • Last active Nov 2019
  • 1 conversations
  • 3 comments

Most recent activity

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

    I did just stick the IR pins without soldering!

    Just curious how I could look into the size of the interrupt buffer? What would be the function call?

    Thanks.

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

    The example comes from here: http://www.espruino.com/Puck.js+Infrared­.

    Here's the output of process.memory() before and after loading the code.

    process.env follows.

    process.memory()
    ={ free: 2217, usage: 33, total: 2250, history: 12,
    gc: 0, gctime: 3.23486328125, "stackEndAddress": 536924008, flash_start: 0, "flash_binary_end": 419924,
    "flash_code_start": 442368, flash_length: 524288 }


    | |_ ___ ___ _ ||___ ___
    | |_ -| . | _| | | | | . |
    |
    |_| || |_|||_|_|

        |_| espruino.com
    

    2v04 (c) 2019 G.Williams

    process.memory()
    ={ free: 2180, usage: 70, total: 2250, history: 46,
    gc: 0, gctime: 3.2958984375, "stackEndAddress": 536924008, flash_start: 0, "flash_binary_end": 419924,
    "flash_code_start": 442368, flash_length: 524288 }

    process.env
    ={
    VERSION: "2v04",
    GIT_COMMIT: "3956264e",
    BOARD: "PUCKJS",
    FLASH: 524288, RAM: 65536,
    SERIAL: "f4801353-1c650745",
    CONSOLE: "Bluetooth",
    MODULES: "Flash,Storage,hea" ... "S,crypto,neopixel",
    EXPTR: 536882364 }

    It is possible that the IR signals are not properly formulated i.e. more than a few transitions.
    But I doubt the stream of data would overflow d[].

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

    While running the following (example) code to read IR signals

    digitalWrite(D2,0);
    pinMode(D1,"input_pullup");
    var d = [];
    setWatch(function(e) {
       d.push(1000*(e.time-e.lastTime));
    }, D1, {edge:"both",repeat:true});
    
    
    var lastLen = 0;
    setInterval(function() {
      if (d.length && d.length==lastLen) {
        d.shift(); // remove first element
        console.log(d.map(a=>a.toFixed(1)).toStr­ing());
        d=[];
      }
      lastLen = d.length;
    },200);
    
    
    

    I get this after a few reads:

    .1,4.6,0.6,0.6,0.6,1.7,0.6,1.7,0.6,1.7,0­.5,0.6,0.6,1.7,0.6,1.7,0.6,1.7,0.6,1.7,0­.6,1.7,0.6,1.7,0.5,0.6,0.6,0.6,0.6,0.6,0­.6,0.5,0.6,1.7,0.6,1.7,0.6,0.6,0.6,1.7,0­.6,0.6,0.6,0.6,0.6,0.5,0.6,0.6,0.6,0.5,0­.6,0.6,0.6,0.6,0.6,1.7,0.6,1.7,0.6,0.5,0­.6,0.6,0.6,0.5,0.6,1.7,0.6,40.0,9.1,2.2,­0.6,97.2,9.1,2.2,0.6
    4.0,3.9,0.6,0.9,0.6,0.8,0.6,0.8,0.6,0.8,­0.6,0.9,0.6,0.9,0.6,0.9,0.6,0.8,0.6,0.9,­0.6,0.8,0.6,0.9,0.6,0.8,0.6,0.8,0.6,0.9,­0.6,0.9,0.6,0.9,0.6,0.8,0.6,0.8,0.6,0.9,­0.6,0.9,0.6,0.8,0.6,0.8,0.6,1.9,0.6,0.9,­0.6
    ERROR: Ctrl-C while processing watch - removing it. Execution
    Interrupted during event processing. New interpreter error:
    CALLBACK,MEMORY ERROR: Ctrl-C while processing interval - removing it.
    Execution Interrupted during event processing.

    What seems to be the issue?

    How do I go about to debug this?

    Thanks!

Actions