Arduino to get some pressure readings but it says there is a wiring problem
after I upload the code to the Serial monitor.
I am using the Adafruit MPRLS library and mprls_simplest code.
I have followed the following page to arrange the circuit and the library
https://learn.adafruit.com/adafruit-mpr ... duino-test
Code: Select all
#include <Wire.h>
#include "Adafruit_MPRLS.h"
// You dont *need* a reset and EOC pin for most uses, so we set to -1 and don't connect
#define RESET_PIN 2 // set to any GPIO pin # to hard-reset on begin()
#define EOC_PIN 3 // set to any GPIO pin to read end-of-conversion by pin
Adafruit_MPRLS mpr = Adafruit_MPRLS(RESET_PIN, EOC_PIN);
void setup() {
Serial.begin(9600);
Serial.println("MPRLS Simple Test");
if (! mpr.begin()) {
Serial.println("Failed to communicate with MPRLS sensor, check wiring?");
while (1) {
delay(10);
}
}
Serial.println("Found MPRLS sensor");
}
void loop() {
float pressure_hPa = mpr.readPressure();
Serial.print("Pressure (hPa): "); Serial.println(pressure_hPa);
Serial.print("Pressure (PSI): "); Serial.println(pressure_hPa / 68.947572932);
delay(1000);
}
11:43:46.546 -> MPRLS Simple Test
11:43:46.583 -> Failed to communicate with MPRLS sensor, check wiring?