Giter VIP home page Giter VIP logo

Comments (7)

caternuson avatar caternuson commented on August 26, 2024

Please post complete code being used to read the data. The rate limit in date reading may be due to something else in code.

from adafruit_mlx90393_library.

SarwarN88 avatar SarwarN88 commented on August 26, 2024

`#include "Adafruit_MLX90393.h"

Adafruit_MLX90393 sensor = Adafruit_MLX90393();
#define MLX90393_CS 10

void setup(void)
{
Serial.begin(115200);

/* Wait for serial on USB platforms. */
while (!Serial) {
delay(10);
}

Serial.println("Starting Adafruit MLX90393 Demo");

//if (! sensor.begin_I2C()) { // hardware I2C mode, can pass in address & alt Wire
if (! sensor.begin_SPI(MLX90393_CS)) { // hardware SPI mode
Serial.println("No sensor found ... check your wiring?");
while (1) { delay(5); }
}
Serial.println("Found a MLX90393 sensor");

sensor.setGain(MLX90393_GAIN_2_5X);
// You can check the gain too
Serial.print("Gain set to: ");
switch (sensor.getGain()) {
case MLX90393_GAIN_1X: Serial.println("1 x"); break;
case MLX90393_GAIN_1_33X: Serial.println("1.33 x"); break;
case MLX90393_GAIN_1_67X: Serial.println("1.67 x"); break;
case MLX90393_GAIN_2X: Serial.println("2 x"); break;
case MLX90393_GAIN_2_5X: Serial.println("2.5 x"); break;
case MLX90393_GAIN_3X: Serial.println("3 x"); break;
case MLX90393_GAIN_4X: Serial.println("4 x"); break;
case MLX90393_GAIN_5X: Serial.println("5 x"); break;
}

// Set resolution, per axis
sensor.setResolution(MLX90393_X, MLX90393_RES_19);
sensor.setResolution(MLX90393_Y, MLX90393_RES_19);
sensor.setResolution(MLX90393_Z, MLX90393_RES_16);

// Set oversampling
sensor.setOversampling(MLX90393_OSR_2);

// Set digital filtering
sensor.setFilter(MLX90393_FILTER_6);
}

void loop(void) {
float x, y, z;

// get X Y and Z data at once
if (sensor.readData(&x, &y, &z)) {
Serial.print("X: "); Serial.print(x, 4); Serial.println(" uT");
Serial.print("Y: "); Serial.print(y, 4); Serial.println(" uT");
Serial.print("Z: "); Serial.print(z, 4); Serial.println(" uT");
} else {
Serial.println("Unable to read XYZ data from the sensor.");
}

delay(2);

}`

from adafruit_mlx90393_library.

SarwarN88 avatar SarwarN88 commented on August 26, 2024

The code currently read all 3 axis.

from adafruit_mlx90393_library.

caternuson avatar caternuson commented on August 26, 2024

How are you determining the read rate? Having serial output in the read loop will slow things down.

from adafruit_mlx90393_library.

SarwarN88 avatar SarwarN88 commented on August 26, 2024

I just count number of samples return per second in the Serial print. It should increase regardless.
True, serial output will slow the sampling rate but I want to check if measuring one axis or increasing frequency will return more samples. Theoretically it should.

from adafruit_mlx90393_library.

caternuson avatar caternuson commented on August 26, 2024

The 2ms delay will also limit the reading to roughly 500Hz. Well below any O(MHz) rate being attempted.

The MLX90393 output data rate (ODR) is not set directly. Instead, there is OSR (oversampling) and DIG_FILT (filtering). The resulting maximum ODR is a fallout of those settings. See Tables 18 and 19 in the datasheet.
image

Getting a rate in the MHz range is not even possible.

from adafruit_mlx90393_library.

Related Issues (13)

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.