/ M4_Eyes / HeatSensor.h
HeatSensor.h
 1  // SPDX-FileCopyrightText: 2019 teejaydub for Adafruit Industries
 2  //
 3  // SPDX-License-Identifier: MIT
 4  
 5  /* Read the IR sensor and try to figure out where the heat is located. 
 6  
 7      Orientation: Looking into the sensor, the window is on the bottom of the silver package,
 8      and the Adafruit star is at the upper left.
 9      X goes from about -1.0 on the left, facing out of the sensor, to +1.0 on the right.
10      Y goes roughly from -1.0 (less?) on the bottom to +1.0 on the top.
11      The sensor is oriented with its text upside down for the moment.
12      Magnitude is currently the maximum temperature of any pixel, in degrees C.
13  */
14  
15  #ifndef __HEAT_SENSOR_H
16  #define __HEAT_SENSOR_H
17  
18  class HeatSensor {
19  public:
20      // The current focus position, each from -1.0 .. +1.0.
21      float x, y;
22  
23      // The current magnitude estimate, in degrees C.
24      float magnitude;
25  
26      // Must be called once.
27      void setup();
28  
29      // Reads the sensor and updates x, y, and magnitude.
30      void find_focus();
31  };
32  
33  #endif