Skip to content

Instantly share code, notes, and snippets.

@weldtype
Created October 5, 2019 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weldtype/7352f9aeb486401821048014cf970dac to your computer and use it in GitHub Desktop.
Save weldtype/7352f9aeb486401821048014cf970dac to your computer and use it in GitHub Desktop.
// 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