Windows.h errors but I did not use it in code

I am creating thermal vision glasses and I always get the "<windows.h> fatal error library not found" even when I didn't use nor include it in the code --exact error message-

-In file included from C:\Users\Admin\Documents\Arduino\libraries\MLX90640_API-master\pch.h:11:0,
                 from C:\Users\Admin\Documents\Arduino\libraries\MLX90640_API-master\MLX90640_API.cpp:1:
C:\Users\Admin\Documents\Arduino\libraries\MLX90640_API-master\framework.h:5:10: fatal error: windows.h: No such file or directory
 #include <windows.h>
          ^~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

code

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <MLX90640_API.h>

#define MLX90640_I2C_ADDR 0x33

#define OLED_RESET -1
Adafruit_SSD1306 display(OLED_RESET);

MLX90640 mlx;

mlx90640_refresh_rate_t refresh_rate = MLX90640_REFRESH_8_HZ;
mlx90640_sample_rate_t sample_rate = MLX90640_SAMPLE_RATE_1_HZ;

void setup() {
  Wire.begin();
  display.begin(SSD1306_SWITCHCAPVCC, 128, 64);
  display.clearDisplay();
  display.display();

  Serial.begin(9600);  // Initialize the Serial port for debuging
}

void loop() {
  MLX90640_ERROR error = MLX90640_Init(refresh_rate, sample_rate, 0);
  if (error != MLX90640_OK) {
      Serial.println("Error initializing MLX90640");
      return;
  }
  float mlx90640To[MLX90640_PIXELS];
  error = MLX90640_GetFrameData(MLX90640_I2C_ADDR, mlx90640To);
  if (error != MLX90640_OK) {
      Serial.println("Error getting MLX90640 data");
      return;
  }
  display.clearDisplay();
  for (int y = 0; y < 24; y++) {
      for (int x = 0; x < 32; x++) {
          float temperature = mlx90640To[y * 32 + x];
          display.fillRect(x * 4, y * 4, 4, 4, temperature < -10 ? BLACK : temperature < 0 ? BLUE : temperature < 10 ? GREEN : temperature < 30 ? RED : temperature < 40 ? ORANGE : temperature < 50 ? YELLOW : temperature < 60 ? WHITE );
      }
  }
  display.display();
}

it will probably be something stupid that I missed

Can you post that file, please?

it said that I'm not allowed to post attachments because I'm a new user

how long do you need to be signed in to be able to post files

Can't you just cut and paste it in some code tags?

I'll try tomorrow

type or paste code here

Isn't that the same code you already posted?

oh, I'm dumber than I thought


#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>    //includes libraries
#include <MLX90640_API.h>

#define MLX90640_I2C_ADDR 0x33

#define OLED_RESET -1
Adafruit_SSD1306 display(OLED_RESET);

MLX90640 mlx;

mlx90640_refresh_rate_t refresh_rate = MLX90640_REFRESH_8_HZ;
mlx90640_sample_rate_t sample_rate = MLX90640_SAMPLE_RATE_1_HZ;

void setup() {
  Wire.begin();
  display.begin(SSD1306_SWITCHCAPVCC, 128, 64);   // displays stuff on monitor
  display.clearDisplay();
  display.display();

  Serial.begin(9600);  // Initialize the Serial port for debuging
}

void loop() {
  MLX90640_ERROR error = MLX90640_Init(refresh_rate, sample_rate, 0);
  if (error != MLX90640_OK) {
      Serial.println("Error initializing MLX90640");
      return;
  }
  float mlx90640To[MLX90640_PIXELS];
  error = MLX90640_GetFrameData(MLX90640_I2C_ADDR, mlx90640To);  //tells when to iniciate an error
  if (error != MLX90640_OK) {
      Serial.println("Error getting MLX90640 data");   
      return;
  }
  display.clearDisplay();
  for (int y = 0; y < 24; y++) {
      for (int x = 0; x < 32; x++) {
          float temperature = mlx90640To[y * 32 + x];
          display.fillRect(x * 4, y * 4, 4, 4, temperature < -10 ? BLACK : temperature < 0 ? BLUE : temperature < 10 ? GREEN : temperature < 30 ? RED : temperature < 40 ? ORANGE : temperature < 50 ? YELLOW : temperature < 60 ? WHITE );
      }
  }
  display.display();
}

added tags

Post #9?

Use the Adafruit MLX90640 library instead.

thanks

this is probably the solution

  • is the soulution

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.