Created
October 5, 2019 21:23
-
-
Save weldtype/7352f9aeb486401821048014cf970dac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// M5StickCでNCIR(MLX90614)を使う | |
// 2019/10/06 edy | |
// | |
// 参考にしたサイト | |
//https://qiita.com/lutecia16v/items/dc92453f0a8937588f15 | |
// | |
// | |
#include <M5StickC.h> | |
#include <Adafruit_MLX90614.h> | |
double ambTemp = 0.0; | |
double objTemp = 0.0; | |
Adafruit_MLX90614 mlx = Adafruit_MLX90614(); | |
void setup() { | |
m5.begin(); | |
Wire.begin(); | |
M5.Lcd.setRotation(4); | |
M5.Axp.ScreenBreath(10); | |
M5.Lcd.setTextColor(WHITE); | |
M5.Lcd.fillScreen(BLACK); | |
} | |
void loop() { | |
ambTemp = mlx.readAmbientTempC(); | |
objTemp = mlx.readObjectTempC(); | |
M5.Lcd.fillScreen(BLACK); | |
M5.Lcd.setCursor(0, 0, 4); | |
M5.Lcd.print(objTemp); | |
Serial.println(objTemp); | |
M5.Lcd.setCursor(0, 40, 4); | |
M5.Lcd.print(ambTemp); | |
Serial.println(ambTemp); | |
delay(500); | |
m5.update(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment