Giter Site home page Giter Site logo

Comments (5)

stevemarple avatar stevemarple commented on May 30, 2024

At this stage the only advice I can give is to submit more detailed error reports. Wiring details, pins used etc are all useful and sometimes necessary information. The Adafruit_MLX90614 library uses the Wire (hardware I2C) library. I have a library (https://github.com/stevemarple/MLX90614) that supports the MLX90614 and it uses SoftWire.

from softwire.

fervidautomation avatar fervidautomation commented on May 30, 2024

Thank you for your response. Please find my code below.
I am getting the reading for MAX30102 only but not for MLX90614. both are working on I2C. I did change pin for MAX30102 but still, code is not working.

#include <Wire.h>
#include "MAX30105.h"
#include <Adafruit_MLX90614.h>
MAX30105 particleSensor; // initialize MAX30102 with I2C

TwoWire I2CBME = TwoWire(0);
#define IR1 0x5A
#define I2C_SDA 33 //21
#define I2C_SCL 32 //22
Adafruit_MLX90614 mlx = Adafruit_MLX90614(IR1);
void setup()
{
Serial.begin(115200);
while(!Serial); //We must wait for Teensy to come online
mlx.begin();
I2CBME.begin(I2C_SDA, I2C_SCL, I2C_SPEED_FAST);

delay(100);
Serial.println("");
Serial.println("MAX30102");
Serial.println("");
delay(100);
// Initialize sensor
// if (particleSensor.begin(Wire, I2C_SPEED_FAST) == false) //Use default I2C port, 400kHz speed
if (!particleSensor.begin(I2CBME, I2C_SPEED_FAST ,0x57))
{
Serial.println("MAX30102 was not found. Please check wiring/power. ");
while (1);
}

byte ledBrightness = 70; //Options: 0=Off to 255=50mA
byte sampleAverage = 1; //Options: 1, 2, 4, 8, 16, 32
byte ledMode = 2; //Options: 1 = Red only, 2 = Red + IR, 3 = Red + IR + Green
int sampleRate = 400; //Options: 50, 100, 200, 400, 800, 1000, 1600, 3200
int pulseWidth = 69; //Options: 69, 118, 215, 411
int adcRange = 16384; //Options: 2048, 4096, 8192, 16384

particleSensor.setup(ledBrightness, sampleAverage, ledMode, sampleRate, pulseWidth, adcRange); //Configure sensor with these settings
}

void loop() {
particleSensor.check(); //Check the sensor
while (particleSensor.available()) {
// read stored IR
Serial.print(particleSensor.getFIFOIR());
Serial.print(",");
// read stored red
Serial.println(particleSensor.getFIFORed());
// read next set of samples
particleSensor.nextSample();
delay(1000);
}
Serial.print("Ambient = ");
Serial.print(mlx.readAmbientTempC());
Serial.print("*C\tObject = ");
Serial.print(mlx.readObjectTempC());
Serial.println("*C");
Serial.print("Ambient = ");
Serial.print(mlx.readAmbientTempF());
Serial.print("*F\tObject = ");
Serial.print(mlx.readObjectTempF());
Serial.println("*F");
Serial.println();
delay(1000);
}

from softwire.

stevemarple avatar stevemarple commented on May 30, 2024

The code you posted uses the Wire library. Does MAX30105.h include or somehow use SoftWire?

from softwire.

fervidautomation avatar fervidautomation commented on May 30, 2024

I am stuck into this problem to use these 2 sensor on esp32, does softwire, can help me?

from softwire.

stevemarple avatar stevemarple commented on May 30, 2024

So you aren't using SoftWire? Please report any software bugs you find to the appropriate place. Do not use abuse issue trackers as a personal helpline. The majority of authors of open-source software contribute their time for free.

from softwire.

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.