Comments (5)
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.
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.
The code you posted uses the Wire
library. Does MAX30105.h
include or somehow use SoftWire
?
from softwire.
I am stuck into this problem to use these 2 sensor on esp32, does softwire, can help me?
from softwire.
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)
- configure SoftWire and set up buffer HOT 1
- setSclLow in the example and setSetSclLow in the include file. HOT 1
- I2C EEPROM example not working correctly (Wire functions used) HOT 1
- Better documentation of run-time setting sda and scl pins HOT 1
- Can't compile the SoftWire_MLX90614 example HOT 1
- Softwire and Heltec OLED HOT 1
- Bug in DS1307 hour in case of 24h mode
- Bug in DS1307 hour in case of 24h mode HOT 1
- calling setClock(0) made arduino micro unrecognizable by windows HOT 5
- Restart condition is not issued HOT 5
- Information request HOT 1
- llStartWait() case nack needs to include break or return HOT 3
- Minimum SCL frequency HOT 5
- Not available on rp2040 (raspberry pie Pico).
- PCF8583 event counter not woking with SoftWire HOT 10
- Air001 sw.write() output is missing HOT 1
- Wire.onRequest(handler) Support?
- softwire i2c for liquid crystal lcd
- example SoftWire_MLX90614 not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from softwire.