This is my first posting in the Forum. If something is wrong or not done properly, please let me know so that I can improve.
I am new to the Arduino world, I started to develop a pretty complex application (for me it is).
My project is to control a Sugar Shack, eventually.
I brooked down my project in sub projects so that I can learn of to used and program the Arduino.
My first sub-project was to set a bunch of thermometers using I2C and read the different thermometers (DS18B20). I have 6 of them on the breadboard. I developped a function that read all of them is sequence, another function will print the different temperatures and a few more functions. I also added to my project a RTC DS1307, I will eventually develop a data logger function using a SD (this is for later on). This first sub-project works like charm on his own.
Second, I develop another sub-project consisting of 7 buttons: 6 of them are used to turn on/off 3 different relays, the 7th will be used to display the different temperature in rotation. I also have a set of LED that represent the state of the relays, these are controlled with a 74HC595. For this sub project, I used the "Example code for multi-button checker with debouncing " which could be found at Example code for multi-button checker with debouncing « Adafruit Industries – Makers, hackers, artists, designers and engineers!. I used the second example with the Interrupt with Timer2.
I am now trying to merge the 2 sub-projects into one. I cannot get the buttons to respond on timely basis if at all. I tried to deactivate the interrupt, changing my subroutine to read the buttons states in the main loop after the function that read the temperature. However the respond time is too slow when a button is pressed, I have to hold to the button for quite a while.
My question is : does the the interrupt (Timer2) can coexist with the reading of the thermometers on I2C. ( I think that there is critical timing between the Arduino and the sensors).
It it can coexist, any suggestion on how to make it works. If not, any suggestion, how I can solve my problem. The temperature must be read regularly and I must be able to press a button and react to it quickly. A quick push on the button, I don't want to have to hold the button down for a lon period of time.