You are reading a single comment by @Ptitonio and its replies. Click here to read the full conversation.
  • Hello ,
    when I save this code on my Pico or EspruiniWiFi :

        var mpu=require(MPU6050);*

    the console return :

    ``` TypeError: Cannot read property 'length' of undefined in MPU6050
    TypeError: Cannot read property 'length' of undefined

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

         |_|  2v00 (c) 2018 G.Williams

    Uncaught SyntaxError: Got '=' expected ',' at line 263 col 65 ...ction(bank, prefetchEnabled=false, userBank=false) {

                              ^ ```

    I tried other module successfully.
    Is the MPU6050 module a problem?
    Am I missing something?

    Thank you for your help

  • Sat 2019.11.16

    Hi @Ptitonio,

    'I tried other module successfully'

    Which module did you have success with?

    I just checked the sample script:

    and it appears there is no binding of the pins for I2C to the MPU6050 using the connect() function. Is all the code actually provided in #1?

    Also, the pin labeling L#1 scl,sda needs another look as the pin numbers are different between devices:

    for instance

    Formatting help suggestion: It appears the reason for the block within the three backticks is not displaying correctly, is that this line 'TypeError: Cannot read property 'length'' needs to start on the next line following the backticks. Both opening and closing backtick group needs to be on its own line.


Avatar for Ptitonio @Ptitonio started