-
Notifications
You must be signed in to change notification settings - Fork 0
/
AMG88XX.h
43 lines (37 loc) · 1.5 KB
/
AMG88XX.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _Arduino_AMG88XX_H_
#define _Arduino_AMG88XX_H_
#include "Arduino.h"
#include "Wire.h"
// Register addresses
#define AMG_REGISTER_PCTL 0x00 // Power control register
#define AMG_REGISTER_RST 0x01 // Reset Register
#define AMG_REGISTER_FPSC 0x02 // Frame rate register
#define AMG_REGISTER_INTC 0x03 // Interrupt control register
#define AMG_REGISTER_AVE 0x07 // Interrupt control register
#define AMG_REGISTER_T01L 0x80 // Pixel 1 Output Value (Lower Level)
#define AMG_REGISTER_T01H 0x81 // Pixel 1 Output Value (Higher Level)
#define AMG_REGISTER_TTHL 0x0E // Thermistor Output Value (Lower level)
#define AMG_REGISTER_TTHH 0x0F // Thermistor Output Value (Higher level)
// Power control register values
#define AMG_PCTL_NORMAL 0x00 // Normal operating mode
#define AMG_PCTL_SLEEP 0x10 // Sleep mode
#define AMG_PCTL_STANDBY10 0x21 // Stand-by (10 sec intermittence)
#define AMG_PCTL_STANDBY60 0x20 // Stand-by (60 sec intermittence)
// Reset register values
#define AMG_RST_FLAGRESET 0x30 // Flag Reset
#define AMG_RST_INITIALRESET 0x30 // Flag Reset
// Frame Rate control register values
#define AMG_FPSC_FRAMERATE_10 0x00 // 10 FPS measurement
#define AMG_FPSC_FRAMERATE_1 0x01 // 1 FPS Measurement
// Functions
void sleep();
void wakeUp();
void reset();
void setMovingAverage(bool movAvg);
void setFrameRate(uint8_t frameRate);
inline void standBy10();
void readValues(float result[]);
float readThermistor();
float calculateVariance(float data[]);
float calculateAverage(float data[]);
#endif