-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathpixels_test.ino
62 lines (44 loc) · 1.54 KB
/
pixels_test.ino
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
/***************************************************************************
This is a library for the AMG88xx GridEYE 8x8 IR camera
This sketch tries to read the pixels from the sensor
Designed specifically to work with the Adafruit AMG88 breakout
----> http://www.adafruit.com/products/3538
These sensors use I2C to communicate. The device's I2C address is 0x69
Adafruit invests time and resources providing this open source code,
please support Adafruit andopen-source hardware by purchasing products
from Adafruit!
Written by Dean Miller for Adafruit Industries.
BSD license, all text above must be included in any redistribution
***************************************************************************/
#include <Wire.h>
#include <Adafruit_AMG88xx.h>
Adafruit_AMG88xx amg;
float pixels[AMG88xx_PIXEL_ARRAY_SIZE];
void setup() {
Serial.begin(9600);
Serial.println(F("AMG88xx pixels"));
bool status;
// default settings
status = amg.begin();
if (!status) {
Serial.println("Could not find a valid AMG88xx sensor, check wiring!");
while (1);
}
Serial.println("-- Pixels Test --");
Serial.println();
delay(100); // let sensor boot up
}
void loop() {
//read all the pixels
amg.readPixels(pixels);
Serial.print("[");
for(int i=1; i<=AMG88xx_PIXEL_ARRAY_SIZE; i++){
Serial.print(pixels[i-1]);
Serial.print(", ");
if( i%8 == 0 ) Serial.println();
}
Serial.println("]");
Serial.println();
//delay a second
delay(1000);
}