Skip to content

Commit bd5562a

Browse files
author
Jim Lindblom
committed
Adding get ID example.
1 parent 7368ff9 commit bd5562a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/******************************************************************************
2+
MLX90614_Get_ID.ino
3+
Print ID register values stored in the MLX90614
4+
5+
This example reads from the MLX90614's ID registers, and
6+
prints out the 64-byte value to the serial monitor.
7+
8+
Hardware Hookup (if you're not using the eval board):
9+
MLX90614 ------------- Arduino
10+
VDD ------------------ 3.3V
11+
VSS ------------------ GND
12+
SDA ------------------ SDA (A4 on older boards)
13+
SCL ------------------ SCL (A5 on older boards)
14+
15+
Jim Lindblom @ SparkFun Electronics
16+
October 23, 2015
17+
https://github.com/sparkfun/SparkFun_MLX90614_Arduino_Library
18+
19+
Development environment specifics:
20+
Arduino 1.6.5
21+
SparkFun IR Thermometer Evaluation Board - MLX90614
22+
******************************************************************************/
23+
24+
#include <Wire.h> // I2C library, required for MLX90614
25+
#include <SparkFunMLX90614.h> // SparkFunMLX90614 Arduino library
26+
27+
IRTherm therm; // Create an IRTherm object to interact with throughout
28+
29+
void setup()
30+
{
31+
Serial.begin(9600); // Initialize Serial to log output
32+
therm.begin(); // Initialize the MLX90614
33+
34+
if (therm.readID()) // Read from the ID registers
35+
{ // If the read succeeded, print the ID:
36+
Serial.println("ID: 0x" +
37+
String(therm.getIDH(), HEX) +
38+
String(therm.getIDL(), HEX));
39+
}
40+
}
41+
42+
void loop()
43+
{
44+
45+
}

0 commit comments

Comments
 (0)