سلام
این ماژول با ولتاژ 3.3V کار میکنه.
این کد رو امتحان کنید:
#include <Wire.h> // Include Wire.h - Arduino I2C library
#include <SparkFunMLX90614.h> // Include IR thermometer library
IRTherm temp; // Create an IRTherm object called temp
void setup(){
temp.begin(); // Initialize I2C library and the MLX90614
temp.setUnit(TEMP_C); // Set units to celcius (alternatively TEMP_C or TEMP_K)
Serial.begin(9600);
}
void loop(){
if (temp.read()) // Read from the sensor
{ // If the read is successful:
float ambientT = temp.ambient(); // Get updated ambient temperature
float objectT = temp.object(); // Get updated object temperature
Serial.println("Ambient: " + String(ambientT));
Serial.println("Object: " + String(objectT));
Serial.println();
}
}
کتابخانه پیوست شده است.