Skillnad mellan versioner av "Grove - Digital Infrared Temperature Sensor"
Rad 48: | Rad 48: | ||
[[Category:Grove]] | [[Category:Grove]] | ||
+ | [[Category:Kna-Wiki]] |
Versionen från 3 februari 2021 kl. 15.10
Temperaturintervall: -40 - 85 C
Kompatibilitet
Port
- Digital
Bibliotek
https://github.com/Seeed-Studio/Digital_Infrared_Temperature_Sensor_MLX90615
Exempelkod
Arduino
#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);
}
Mer information
http://wiki.seeedstudio.com/Grove-Digital_Infrared_Temperature_Sensor/