Serial Monitor Help

My group and I are building a project for class, and we keep running into issues. Sometimes the arduino program works and sometimes it seems like our project is hopeless. We're using an Arduino Nano w/ ATmega 328. I'm the designated coder, and I'm lost. The premise of our project is we're using a Temp Sensor, and we got the code from Adafruit. We want to see the temperature of the ambient (surrounding area) and the object that the sensor is facing. The serial monitor opens and just says "ambient = " and then freezes. Help!

Thank you!

Code looks like this:

#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

const int kPinLed = 9;

void setup() {

Serial.println("Adafruit MLX90614 test");



void loop() {
Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF());
Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");

if (mlx.readObjectTempF()>=90.00)
//turn on

//turn off


The serial monitor opens and just says "ambient = " and then freezes. Help!

So, your code looks like:

void setup()
   Serial.print("ambient = ");

void loop()

What you see is what I'd expect.

Of course, if your code looks different, then it behooves you to POST YOUR DAMNED CODE!

Paul's made over 55 thousand posts and probably 20% of those were because people didn't bother to learn how to make a proper post in the first place. Read the two posts at the top of this Forum by Nick Gammon. Next, place your code in the IDE and use Ctrl-t to format it in a form we like. Finally, use Ctrl-A and then Ctrl-C to copy your code for a post, placing it between the code tags before using Ctrl-V. Paul and a bunch of others would appreciate it.

Econ, it shows me your post was made at 8:13pm and the OP's last edit was 4:13, so it appears that the first post was edited after Paul asked for the code.

Anyway, to answer the original question, it appears that the program is stopping somewhere inside mlx.readAmbientTempC(). My usual debugging technique here is to open up the .cpp file inside the library and start spraying around Serial.println("Here7!") everywhere. (different numbers in different places). Then you will find out what the error is in the code, or if it's something simple like the sensor not connected properly.