Hi
As described in header. I wants to switch from delay witch in my case isn't going to make my day ... I've read several posts and reference material about it, but either I'm plain stupid or something...
Could someone point me in the right direction, I post my code that I use now. I Wants to read the Dallas sensor, then show that on the LCD, after 5 seconds I wants to show the FAN rpm for 5 seconds. I also need to change the void fanRPM function and remove delay from that one to.
Before someone will advise you not to use interrupt, do some reading on it.
Than start with how to generate the interrupt at 5 seconds interval. Using delay will do.
Than figure out what code you are interrupting and what process you want to execute and when.
You have decent code base you just need to “plug” in ( and modify) into interrupt driven process.
Good luck.
Than start with how to generate the interrupt at 5 seconds interval. Using delay will do
No, I didn't understand that either.
I think it is supposed to read "Rather than starting with how the generate the interrupt at 5 second intervals", but then it all goes wrong.
If you look at the blink without delay example, you will find a technique to schedule events without the added complexity of interrupts or having to
Vaclav:
Using interrupts could be useful for me in the future. I've learning Arduino now for the major project to my water chilled computer. But here I only needed some thing to get ride of delay so I can process several things almost at the same time...
Robin2:
Thanxs for putting me in the right direction, I'm still learning why and how it works but slowly like a pwm signal it will be lit someday . I rewrote the code like this, can't figure out thou why I don't receive any transmission from the Arduino but I will solve it ( hopefully)...
I guess tempDevice0 is a global variable but I can't guess if it is an INT or BYTE or FLOAT
Change the code in loop() to the following as a temporary test
void loop()
{
showTemp();
Serial.println(tempDevice0);
delay(1000); // don't worry, this is just for testing to slow the output to the monitor
}
If that works then look carefully at how you are trying (unsuccessfully) to deal with the Serial stuff. Go through your code line by line and write down what happens at each step. Then consider whether you have considered every possibility.