#include <Wire.h>; #include <Adafruit_MLX90614.h>; Adafruit_MLX90614 mlx = Adafruit_MLX90614(); String inputString = ""; bool stringComplete = false; //----------------------------------------------- // CONFIGURACION //----------------------------------------------- void setup() { inputString.reserve(32); Serial.begin(9600); mlx.begin(); } //----------------------------------------------- // MAIN //----------------------------------------------- void loop() { if (stringComplete) { if(inputString.substring(0,2)=="MT"){ Serial.print(mlx.readAmbientTempC()); Serial.print("/"); Serial.print(mlx.readObjectTempC()); } inputString = ""; stringComplete = false; } } //----------------------------------------------- void serialEvent() { while (Serial.available()) { char inChar = (char)Serial.read(); inputString += inChar; if (inChar == '\n') { stringComplete = true; } } } //-----------------------------------------------
miércoles, 6 de mayo de 2020
App Inventor Arduino MLX90614 - Prueba
Suscribirse a:
Enviar comentarios (Atom)
IRC
#freenode->#usljujuy
No hay comentarios:
Publicar un comentario