Author Topic: Timer.h and has alarm  (Read 2378 times)

Twistit

  • Newbie
  • *
  • Posts: 19
Timer.h and has alarm
« on: July 20, 2014, 06:23:52 am »
Attached program runs fine, measures temp's and turns my fan on when the temp goes to high on insidethermometer.
Using timer.h to have it check temps and alarms every 30 sec's.. How ever when both my ds18b20's hit alarm temp it goes nuts.
My serial console gets spammed and the web interface turns non-responsive :(

Never tested it with both sensors in alarm state and now i have no idea why it's doing what it's doing.
Guessing it's something stupid..

Anyone mind having a look?

http://pastebin.com/3qXPAsjM


Amus3d

  • Newbie
  • *
  • Posts: 31
Re: Timer.h and has alarm
« Reply #1 on: July 20, 2014, 11:17:44 am »
see youve made use of my code lol. ive never used the alarm on the ds20,

i just read sensor every 15 minutes,  ie


  sensors.requestTemperatures();

 if(readTemp(insideThermometer)=>20)
 digitalWrite(pin, HIGH); // swicth Fan On
 else
 digalWrite( pin , LOW);

 if(readTemp(insideThermometer)=<10)
 digitalWrite(pin, HIGH); // switch heater ON
 else
 digalWrite( pin , LOW);

Temp should be between 18c and 24c if youre growing what i think youre growing lol
Humidity 45 to 60;


« Last Edit: July 20, 2014, 11:28:26 am by Amus3d »

Twistit

  • Newbie
  • *
  • Posts: 19
Re: Timer.h and has alarm
« Reply #2 on: July 21, 2014, 01:24:38 pm »
Haha well I'm growing a tortoise if that's what you were thinking ;) But yeah i did make use of your code, had a whole lot more going on until my Arduino IDE crashed.

You'd figure I'd learn from all those lost essays due to lack of saving....

The temps are also going to control different light bulbs at different temps and hit fans if it still goes up to high.

Guess just reading every so many minutes works as well, just figured the alarm thingamajig looked fancy haha.