the scope of the project is to be able to monitor temperature and activate relays according to the temperature, goes deeper i need to make lcd menus but thats for later, right now i have more of a dilema, i am able to see the data through the serial monitor, and i am using PLX-DAQ to shove all the data into an excel file, that's not a problem, the problem is that when reading the thermocouple, adding a delay is necessary so it doesn't send too much unnecessary data through the serial port, because when reading temperature is not critical to read every 1/2 second, so acquiring a reading of the temperature every few seconds is fine, problem is that the lcd i use to display the temp has buttons, and i use them for other stuff, and when i add the "delay" so the serial port doesn't get stuffed with unnecessary data, the button readings get delayed as well, is there any way to send data through the serial port at intervals? like every 5 seconds or so without affecting any other routing running on the arduino?
is a good example, but the problem is that i am not using buttons connected to the arduino, these buttons are connected to an arduino shield, and being read by a chip on the shield, the arduino only asks for its state through the i2c bus, so i'm not sure i can use the millis method?
BlueLoneWolf:
but the problem is that i am not using buttons connected to the arduino
So?
BlueLoneWolf:
these buttons are connected to an arduino shield, and being read by a chip on the shield, the arduino only asks for its state through the i2c bus
So?
so i'm not sure i can use the millis method?
Why not? The millis model shows how to perform an action at intervals without a delay(). You're asking how to print to the serial port at an interval without a delay(). What does external hardware have to do with this?
BlueLoneWolf:
is a good example, but the problem is that i am not using buttons connected to the arduino, these buttons are connected to an arduino shield, and being read by a chip on the shield, the arduino only asks for its state through the i2c bus, so i'm not sure i can use the millis method?
like this...?
unsigned long lastTime;
void setup()
{
Serial.begin(115200);
}
void loop()
{
if (millis() - lastTime >= 5000UL)
{
Serial.println(myTemperature());
lastTime += 5000UL;
}
}
float myTemperature()
{
// calculate your temperature
float temp = 77.0;
return temp;
}