Hi,
I have a question on how to use a Grove Infrared Temp Sensor ( http://wiki.seeedstudio.com/Grove-Digital_Infrared_Temperature_Sensor/ ) with my Teensy 3.2.
I connected the SDA of the sensor to SDA0 and the SCL to SCL0.
I installed the MLX90615 library and tried to run the singleDevice example:
I get an "#error unknown CPU" error. So I think the Teensy CPU is not deifned in this library? What would be the best way to read the sensor data? I think I need the calculation in the library to get the correct temperature? But the I2C seems to not be working with the Teensy. Any help would be much appreciated
Thank you and best regards,
Stefan
I have a question on how to use a Grove Infrared Temp Sensor ( http://wiki.seeedstudio.com/Grove-Digital_Infrared_Temperature_Sensor/ ) with my Teensy 3.2.
I connected the SDA of the sensor to SDA0 and the SCL to SCL0.
I installed the MLX90615 library and tried to run the singleDevice example:
Code:
#include "MLX90615.h"
#include <I2cMaster.h>
#define SDA_PIN 3 //define the SDA pin
#define SCL_PIN 2 //define the SCL pin
SoftI2cMaster i2c(SDA_PIN, SCL_PIN);
MLX90615 mlx90615(DEVICE_ADDR, &i2c);
void setup()
{
Serial.begin(9600);
Serial.println("Setup...");
//mlx90615.writeEEPROM(Default_Emissivity); //write data into EEPROM when you need to adjust emissivity.
//mlx90615.readEEPROM(); //read EEPROM data to check whether it's a default one.
}
void loop()
{
Serial.print("Object temperature: ");
Serial.println(mlx90615.getTemperature(MLX90615_OBJECT_TEMPERATURE));
Serial.print("Ambient temperature: ");
Serial.println(mlx90615.getTemperature(MLX90615_AMBIENT_TEMPERATURE));
delay(1000);
}
I get an "#error unknown CPU" error. So I think the Teensy CPU is not deifned in this library? What would be the best way to read the sensor data? I think I need the calculation in the library to get the correct temperature? But the I2C seems to not be working with the Teensy. Any help would be much appreciated
Thank you and best regards,
Stefan