I have a Microview connected to an MLX90614 https://www.sparkfun.com/products/9570 Infrared Thermometer (I2C) using https://github.com/adafruit/Adafruit-MLX90614-Library.
Works great… SOMETIMES: Always when Microview Programmer is in between the host circuit and the Microview. Occasionally it works when the Microview is inserted directly into the host circuit.
There is some characteristic on the Microview Programmer that makes things work… Looking for ideas… Obviously We don’t want to have to have the programmer in place to make things work. (BTW. Doesn’t matter whether the programmer is plugged in to USB or not. Power is coming from my own on-board supply.)
The code snippet here is what I do during setup… Looking for a valid range of values… When it cannot read it, I get values way outside this range. When everything is OK, the read back value is within this range.
#include <MicroView.h>
#include <Time.h>
#include "pitches.h"
#include <Average.h>
#include <Wire.h>
#include <EEPROM.h>
#include <Adafruit_MLX90614.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
<... stuff removed....>
int startup_trys=0;
do {
mlx.begin();
temp_deg_f = mlx.readObjectTempF();
dtostrf(temp_deg_f, 5, 1, disp_str);
uView.setFontType(0);
uView.setCursor(0,0);
if (temp_deg_f < 20 || temp_deg_f > 212) {
mlx_present = 0;
uView.print(startup_trys);
uView.print(" No MLX\n");
uView.print(disp_str);
uView.display();
delay(3000);
} else {
mlx_present = 1;
uView.print(startup_trys);
uView.print(" MLX OK\n");
uView.display();
delay(3000);
break;
}
startup_trys++;
}
while (!mlx_present);