Skip to content

Running into issues with the example code. #4

Description

@ManiLowc

Subject of the issue

Hello, I'm attempting to use the MLX90640 with the example code generously made available but am running into some issues.

When I compile the Example1_BasicReadings the text below appears in the output window:

Example1_BasicReadings: In function 'void loop()':
Example1_BasicReadings:83: warning: unused variable 'vdd'
float vdd = MLX90640_GetVdd(mlx90640Frame, &mlx90640);

       ^

Sketch uses 31308 bytes (5%) of program storage space. Maximum is 524288 bytes.
Global variables use 19160 bytes (7%) of dynamic memory, leaving 242976 bytes for local variables. Maximum is 262136 bytes.

I get similar messages when I compile the second and third example code:

Example2_OutputToProcessing: In function 'void loop()':
Example2_OutputToProcessing:81: warning: unused variable 'status'
int status = MLX90640_GetFrameData(MLX90640_address, mlx90640Frame);

     ^

Example2_OutputToProcessing:83: warning: unused variable 'vdd'
float vdd = MLX90640_GetVdd(mlx90640Frame, &mlx90640);

       ^

Example2_OutputToProcessing:77: warning: unused variable 'startTime'
long startTime = millis();

    ^

Example2_OutputToProcessing:91: warning: unused variable 'stopTime'
long stopTime = millis();

    ^

Sketch uses 31228 bytes (5%) of program storage space. Maximum is 524288 bytes.
Global variables use 19160 bytes (7%) of dynamic memory, leaving 242976 bytes for local variables. Maximum is 262136 bytes.

Example3_MaxRefreshRate: In function 'void loop()':
Example3_MaxRefreshRate:96: warning: unused variable 'status'
int status = MLX90640_GetFrameData(MLX90640_address, mlx90640Frame);

     ^

Example3_MaxRefreshRate:99: warning: unused variable 'vdd'
float vdd = MLX90640_GetVdd(mlx90640Frame, &mlx90640);

       ^

Sketch uses 31460 bytes (6%) of program storage space. Maximum is 524288 bytes.
Global variables use 19160 bytes (7%) of dynamic memory, leaving 242976 bytes for local variables. Maximum is 262136 bytes.

The first example seems to work and when I open the serial monitor I see temperatures for 9 pixels.
The second example also seems to work but when I open the Processing code and attempt to run, sometimes I receive the error "ArrayIndexOutOfBoundsException: 87" with the display being completely red, but othertimes it seems to work fine and displays what the camera sees.
When I try to use the third example, I usually get the error "ArrayIndexOutOfBoundsException: xxx" (where xxx are numbers that seems to change) where the display is completely red but sometimes I get "ArrayIndexOutOfBoundsException: 1" where the display at first seems correct but then freezes.
Also when the error appears, the 98th line of code "if(!Float.isNaN(float(splitString[q])) && float(splitString[q]) > maxTemp){" becomes highlighted.

Your workbench

  • What platform are you using?
    I'm using the Teensy 3.5, a breadboard, Qwiic IR Array MLX90640 and qwiic connector cable as recommended on the sparkfun website (please find picture below). I am running the software on my laptop.
  • What version of the device are you using? Is there a firmware version?
    I'm using Arduino 1.8.8 and the newest Teensyduino downloadable.
  • How is the device wired to your platform?
    It is connected via USB.
  • How is everything being powered?
    It is being powered by my laptop.
  • Are there any additional details that may help us help you?
    I'm a coding novice. I have downloaded the MLX90640 libraries necessary.

Steps to reproduce

Tell us how to reproduce this issue. Please post stripped down example code demonstrating your issue to a gist.

Expected behaviour

I expected the display to have a higher refresh rate when using example code 3.

Actual behaviour

I receive ArrayIndexOutOfBoundsException errors.

20190303_180647
20190303_180713

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions