Avatar for ioi-655321

ioi-655321

Member since Jul 2018 • Last active Jan 2025
  • 7 conversations
  • 22 comments

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for ioi-655321

    If I make any real progress I will do so.

  • in Pico / Wifi / Original Espruino
    Avatar for ioi-655321

    I realized the the error Uncaught InternalError: Timeout on I2C Write BUSY was because of bad header pins! I somehow got a batch of headers that didn't have any beveling on them, this caused damage to my solderless breadboard and contrsibuted to a poor connection. I always use high quality solderless breadboards to reduce issues but I never anticipated bad header pins!

    I think how the module initiates the MPU isn't perfect but it does work well enough for my purposes. If I have time , I might go though the module and modify it for myself. I want to see if I can make initialization more consistent and I want to eliminate verbose warning and error messages. My end goal it to interface my "robot" with an app on my phone(written with droidscript) . I like being able to interface directly using the console over BLE (jolt), it is very powerful and is one of the best features of the espruino environment. I don't want to filter all these warning messages from the module. The "puck" addon in Droidscript works flawlessly for interfacing with the espruino console over BLE and I have been using that for a bunch of little things. I like that I can program any BLE Espruino with my phone. I wrote a droidscript app with a dropdown menu of programs that I can upload at-will to espruino and it is very handy!

    When I get home from work I will try to use the soft I2c connection to see if it helps with MPU initialization, thanks for the suggestion! I forgot that I can do that.

    Keep up the good work with Espruino, It is by far my favorite platform for tinkering.

  • in Pico / Wifi / Original Espruino
    Avatar for ioi-655321

    Thank you for your quick response, I took a look at the module and it didn't occur to me that the default parameters would be an issue.

    I'm still having some issues with this module but I think it is mostly how I'm starting the I2c Communications when Loading this code to RAM.

    It sometimes works and starts up right way but a lot of the time it fails to start. I get this:

    ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v25 (c) 2024 G.Williams
    >
    Uncaught InternalError: Timeout on I2C Write BUSY
     at line 1 col 29
    this.i2c.writeTo(this.addr,a);return this.i2c.readFrom(this....
                                ^
    in function "readBytes" called from line 1 col 25
    var g=this.readBytes(a,1)[0],f=(1<<d)-1<<b-d+1;g=g&~f|e<<b-d...
                            ^
    in function "writeBits" called from line 1 col 25
    this.writeBits(107,2,3,a)
                            ^
    in function "setClockSource" called from line 1 col 22
    this.setClockSource(1);this.setFullScaleAccelRange(0);this.s...
                         ^
    in function "initialize" called from line 1 col 74
    ...===b?105:b;this.initialize()
                                  ^
    in function "c" called from line 1 col 10
    new c(a,b)
             ^
    in function "connect" called from line 23 col 44
    const MPU = require("MPU6050").connect(I2C1);
                                               ^
    Resetting MPU6050...
    Uncaught Error: Can't read property 'reset' of undefined
     at line 1 col 45
    ...tting MPU6050...");this.mpu.reset();setTimeout(k,30,this)
                                  ^
    in function "initialize" called from line 1 col 44
    this.mpu=a;this.fifoRate=b;this.initialize()
                                               ^
    in function "c" called from line 1 col 10
    new c(a,b)
             ^
    in function "create" called from line 25 col 49
    const DMP = require("MPU6050_DMP").create(MPU, 1);
    

    I will play with it more to find the source of the issue. I will play with putting the code in flash and setting up the I2c using onInit().

    I remember getting I2C devices to initialize is tricky and this may be an issue with how I'm doing things

    Thanks again !

  • in Pico / Wifi / Original Espruino
    Avatar for ioi-655321

    My goal is to use this module with a Jolt.js I just got. I have the Jolt attached to a little robot chassis. The issue with the small robot is that I don't know if it is going a a straight line or not, so I want to incorporate an MPU to track the "yaw" of the chassis as it drives along and eventually correct itself.
    If anyone reading this knows of a better MPU or has suggestions please drop a comment.

  • in Pico / Wifi / Original Espruino
    Avatar for ioi-655321

    I'm not sure what the issue is with this module(MPU 6050), but it only works when using the web IDE using Minification; specifically "Closure(online) - Simple Optimizations" , It fails when using Esprima (offline) or any other minification.

    I'm currently trying to use this module on a Pico that was just updated to the latest firmware (2v25)
    I have a working mpu6050 and I can get it to function under these very strict circumstances, but it feels like a kludge.

    I'm just wondering why it would only work under such specific circumstances, is there anything that could be done to make the module more reliable?

    This is not a huge concern but I'm wondering if there are some obvious reasons this module would behave this way.

    I2C1.setup({scl:B6, sda:B7, bitrate:100000});
    const MPU = require("MPU6050").connect(I2C1);
    // 2nd parameter is the fifoRate. The DMP output frequency = 200Hz / (1 + fifoRate)
    const DMP = require("MPU6050_DMP").create(MPU, 1);
    
    function pidLoop(args) {
      if (digitalRead(B5)) {
      var data = DMP.getData();
      if(data !== undefined) console.log(DMP.getYawPitchRoll(data));
    }
    }
    

    I get this error :

    Uncaught SyntaxError: Got '!' expected ','
    at line 1 col 2110
    ...yBank=function(a,bundefined!1,dundefined!1){a&=31,d&&(a|=32)...

  • in The Place for Patreon Patrons
    Avatar for ioi-655321

    I would be happy to contribute to the espruino community!

  • in The Place for Patreon Patrons
    Avatar for ioi-655321

    thanks for your help! I will play around with this method and write some code to produce the correct strings of bits. I'll do some testing with a sent decoder. If I find that it works well, I can try to write something up, perhaps others will find this useful.

  • in The Place for Patreon Patrons
    Avatar for ioi-655321

    I would really like to try it on the nRF52, i can verify with an ocsilloscope , if anything it will be a learning experiance.

Actions