I'm developing one of my old projects and I've hit a stumbling block. The old code simply read 4 x DS18B20's and use the data to control the out put to a heat via Henrik's PID routine. It's been working fine for 5 years now, but I want to add 4 x AM2302's to monitor the humidity and also monitor the temperature in its location. The code includes DT's interrupts, DS18B20, and all digital "library files", and thus a lot of the timings for the period each heater is on is done in the background, and the main code consists of a simple loop that reads the sensors and does the maths.

However with four sets of information for each of the four viavriums the 20 x 4 LCD is becoming a little crowded. So what I really want to do is to display Viv(x), temp1, humidity1, temp2 on a single line on the LCD. No problem in coding the line to do this, but as the program runs so fast through the data it's impossible to read. The simple way is to add a pause statement so for example the code pauses for 2 seconds before retuning to the main program loop and advancing on to the next set of data. But this then delays the speed at which the probes are monitored and by the time the loop is back to probe 1 the temperature could of gone past the set point, as it's not monitored in real time.

My hair is now white, and I'm half bald trying to resolve this - the nearest I came was to use some form of counting loop within the main loop, that when it tripped over a set value it increased the value of viv(x) by one, so in essence the main code ran at real time speed, but the LCD was only updated every second or so and thus wouldn't hold up the realtime monitoring. Unless any of you guys can come up with a better suggestion