Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ 41874][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error -1 #29

Open
hc9898 opened this issue Feb 18, 2024 · 0 comments

Comments

@hc9898
Copy link

hc9898 commented Feb 18, 2024

[ 41874][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error -1

I am using altimeter sensor, MPL3115A2 for measuring the height, but I get the above error for output. Can anyone explained to me what is this error and how to solve this problem? I worry that the error will affect the height reading of the sensor.

Code:
#include <Wire.h>
#include <Adafruit_MPL3115A2.h>

Adafruit_MPL3115A2 baro = Adafruit_MPL3115A2();

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.println(“\n\n========= Height of Flying Drone =========”);

if (! baro.begin())
{
Serial.println(“Invalid Input!!”);
return;
}

float altm = baro.getAltitude();
Serial.print(altm);
Serial.print(" meters\n");
delay(1000);
}

This is my code.

I used the library, Adafruit_MPL3115A2.
FYI, the board that I am using is ESP32 dev board, and platformio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant