-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpg 4
More file actions
84 lines (61 loc) · 2.11 KB
/
pg 4
File metadata and controls
84 lines (61 loc) · 2.11 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//copyright 2020 Alexander I Rusich
#pragma once
#include "oled.h"
/*
Read the MLX90640 temperature readings as quickly as possible
By: Nathan Seidle
SparkFun Electronics
Date: May 22nd, 2018
License: MIT. See license file for more information but you can
basically do whatever you want with this code.
Feel like supporting open source hardware?
Buy a board from SparkFun! https://www.sparkfun.com/products/14769
This example reads the MLX90640 and outputs 768 temperature values as fast as possible.
Use this example in conjunction with our Processing visualizer.
We use the Teensy 3.5 for this example. The MLX90640 requires some
hefty calculations and larger arrays. You will need a microcontroller with 20,000
bytes or more of RAM.
This relies on the driver written by Melexis and can be found at:
https://github.com/melexis/mlx90640-library
Hardware Connections:
Connect the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
to the Qwiic board
Connect the male pins to the Teensy. The pinouts can be found here: https://www.pjrc.com/teensy/pinout.html
Open the serial monitor at 115200 baud to see the output
*/
#include "arduino.h"
#include <Wire.h>
#include <MLX90640_API.h>
#include <MLX90640_I2C_Driver.h>
#include <string>
//const byte MLX90640_address = 0x33; //Default 7-bit unshifted address of the MLX90640
#define TA_SHIFT 8 //Default shift for MLX90640 in open air
//should pass state too
#define IRADDRESS1 0x33
#define IRADDRESS2 0x33
#define IRADDRESS3 0x33
#define IRADDRESS4 0x33
#define IRADDRESS5 0x33
#define IRADDRESS6 0x33
class CIRArray{
private:
COLED Display;
int imin,imax;
paramsMLX90640 mlx90640;
float mlx90640To[768];
float favg=0.0;
long last=0;
char pixelTable[770]; //need it null terminated
char address=IRADDRESS1;
long interval=25000;
char calcStart = 0x33; //Pin that goes high/low when calculations are complete
//This makes the timing visible on the logic analyzer
char cState='a';
bool bReady=false;
public:
CIRArray() { }
bool isConnected();
void setup();
void loop();
void Output();
};