GithubHelp home page GithubHelp logo

Comments (9)

mdjavedakhtar avatar mdjavedakhtar commented on June 5, 2024 1

i am using SWire instead of Wire so will do the needed changed and let you know after test latter today

from gy521.

RobTillaart avatar RobTillaart commented on June 5, 2024

It is rather late now, will check later this week - I did not encounter this problem yet.

Solution should be to add a wakeup() call in begin()

something like

bool GY521::begin()
{
  _wire->begin();
  if (isConnected())
  {
    return wakeup();
  }
  return false;
}

ESP -begin() too of course.

from gy521.

RobTillaart avatar RobTillaart commented on June 5, 2024

From Datasheet
image

Problem might be caused by the SLEEP or the CYCLE bit being set.

Can you read the register and post its content (hex value?)

from gy521.

RobTillaart avatar RobTillaart commented on June 5, 2024

(TEMP_DIS = disable temp sensor, seems less relevant)

from gy521.

mdjavedakhtar avatar mdjavedakhtar commented on June 5, 2024

Will surely post in sometime. Not near laptop now and it's 1:35am here
And yes I also think it's related to sleep / cycle bit

I have tested this with 3 different modules and all ware same

from gy521.

RobTillaart avatar RobTillaart commented on June 5, 2024

If time permits I make a PR tomorrow. Have a good night!

from gy521.

RobTillaart avatar RobTillaart commented on June 5, 2024

started with PR in https://github.com/RobTillaart/GY521/tree/develop
(also updating build-CI ++)

update: build successful,
Can you please verify if this branch for you works as expected?

from gy521.

RobTillaart avatar RobTillaart commented on June 5, 2024

I noticed that in the examples I used a loop around wakeup()
That might be a solution if the single wakeup() call is not enough.

  Wire.begin();

  delay(100);
  while (sensor.wakeup() == false)
  {
    Serial.print(millis());
    Serial.println("\tCould not connect to GY521");
    delay(1000);
  }

from gy521.

mdjavedakhtar avatar mdjavedakhtar commented on June 5, 2024

I noticed that in the examples I used a loop around wakeup() That might be a solution if the single wakeup() call is not enough.

  Wire.begin();

  delay(100);
  while (sensor.wakeup() == false)
  {
    Serial.print(millis());
    Serial.println("\tCould not connect to GY521");
    delay(1000);
  }

This works fine.

from gy521.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.