Avatar for parasquid

parasquid

Member since Jun 2019 • Last active Aug 2020
  • 5 conversations
  • 52 comments

Most recent activity

  • Avatar for parasquid

    Just an update: it works! :)

    My order for the voltage regulators from digikey just came and although I knew that they were small, I didn't expect it to be really small when not soldered to anything.

    It wasn't my best soldering job as my hands are too shaky with the tight tolerances around the components, but even though I bodged it the module works again :)

  • Avatar for parasquid

    Ah I was uploading to RAM. Uploading to flash works :) (I didn't upload to flash because I had to reset the Pixl when the memory issues came up during upload)

    And yeah, modules uploaded as functions is checked.

    The module seems to be working, and is quite performant :) Thanks again for the help!

  • Avatar for parasquid

    Strangely, trying to upload the code again after the memory problem works. I guess I'll work with this for now :)

  • Avatar for parasquid

    I might have spoken too soon; closing and then reopening the Espruino editor gives me a memory error again:

    No errors in https://raw.githubusercontent.com/esprui­no/EspruinoDocs/master/devices/MPU6050_D­MP.js. Minifying 34114 bytes to 8589 bytes
    No errors. Minifying 14282 bytes to 12744 bytes
    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v06 (c) 2019 G.Williams
    >Resetting MPU6050...
    New interpreter error: LOW_MEMORY,MEMORY
    OTP bank is valid!
    Uncaught Error: Function or String not supplied!
     at line 1 col 353
    ...r();setTimeout(e,20,a,c,g,h)
                                  ^
    in function called from system
    
  • Avatar for parasquid

    setting both editor and module to closure simple optimizations works!

    No errors. Minifying 14282 bytes to 12743 bytes
    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v06 (c) 2019 G.Williams
    >Resetting MPU6050...
    OTP bank is valid!
    Success! DMP code written and verified.
    Success! DMP configuration written and verified.
    FIFO count: 84 Data: 63,255,238,253,0,46,156,106,255,254,101,­6,0,1,165,107,255,254,76,31,255,255,88,8­9,0,0,67,14,255,248,58,153,255,125,61,21­8,17,187,240,115,178,106,63,255,245,148,­0,36,48,162,255,251,206,109,0,2,164,50,2­55,254,76,31,255,255,77,44,0,0,67,14,255­,242,133,74,255,88,179,152,23,30,78,155,­178,106
    IntStatus: 7
    FIFO count: 210 Data: 63,253,254,164,254,255,215,54,0,8,189,86­,0,3,123,84,255,254,76,31,255,255,65,254­,0,0,78,59,255,240,234,183,255,61,205,82­,25,253,25,113,178,106,63,254,25,27,255,­6,103,126,255,254,244,193,0,4,124,176,25­5,254,87,76,255,255,77,44,0,0,67,14,255,­248,200,130,255,47,96,246,27,142,83,194,­178,106,63,254,108,71,255,28,202,54,0,4,­39,61,0,5,178,250,255,254,76,31,255,255,­77,44,0,0,67,14,255,253,191,163,255,41,1­61,249,28,105,250,127,178,106,63,254,17,­157,255,6,135,65,0,31,114,164,0,7,70,45,­255,254,76,31,255,255,65,254,0,0,67,14,2­55,245,96,37,255,40,106,35,28,225,39,172­,178,106,63,254,60,201,255,18,150,132,0,­36,61,34,0,8,166,21,255,254,87,76,255,25­5,65,254,0,0,67,14,255,240,89,161,255,36­,214,214,29,40,147,213,178,106
    IntStatus: 3
    DMP is good to go! IntStatus: 3
    

    I guess it just barely gets it.

    However, I'm planning to use this to stream accelerometer data over BLE so I'm afraid even if the example works, adding more of my own code might take me over the memory limit :(

    I'll see what I can do in the meantime :) Thanks!

  • Avatar for parasquid

    closure with simple optimizations gives

    No errors in https://raw.githubusercontent.com/esprui­no/EspruinoDocs/master/devices/MPU6050_D­MP.js. Minifying 34114 bytes to 8589 bytes
    No errors. Minified 14282 bytes to 13871 bytes.
    >
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v06 (c) 2019 G.Williams
    >Execution Interrupted
    New interpreter error: LOW_MEMORY,MEMORY
    > 
    
  • Avatar for parasquid

    Here's the code I'm using btw (the same as in the docs, just the I2C options and trigger changed)

    I2C1.setup({scl:A5, sda:A4});
    
    const MPU = require("MPU6050").connect(I2C1);
    // 2nd parameter is the fifoRate. The DMP output frequency = 200Hz / (1 + fifoRate)
    const DMP = require("https://raw.githubusercontent.c­om/espruino/EspruinoDocs/master/devices/­MPU6050_DMP.js").create(MPU, 3);
    
    function pidLoop(args) {
      var data = DMP.getData();
      if(data !== undefined) console.log(DMP.getYawPitchRoll(data));
    }
    
    setWatch(pidLoop, D13, { repeat:true, edge:'rising' });
    
Actions