Skip to content

Commit 8c65cf4

Browse files
author
Jim Lindblom
committed
Adding set emmissivity example.
1 parent c720bb6 commit 8c65cf4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/SparkFunMLX90614.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ uint8_t IRTherm::setEmissivity(float emis)
185185
return 0; // Return fail if not
186186
// Calculate the raw 16-bit value:
187187
uint16_t ke = uint16_t(65535.0 * emis);
188+
ke = constrain(ke, 0x2000, 0xFFFF);
189+
188190
// Write that value to the ke register
189191
return writeEEPROM(MLX90614_REGISTER_KE, (int16_t)ke);
190192
}

0 commit comments

Comments
 (0)