Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / 10 Minutes Timer Millis() on: September 17, 2013, 08:07:19 pm
Hey Guys...

I need a little help with my code, i've one Lm335 (Temperature Sensor), and i need to do this:

When the temperature goes higher than 30º, one 2 minutes timer starts, and in the end of that 2 minutes ive to check the temperature again and if it still higher than 30º one I/O port goes HIGH for 30 minutes, and every time the temperature goes higer than 30 that 30 minuter timer resets.

This is what i need but im stuck at the first part. (Goes higher than 30, wait 2 minutes, check temperature again and change one I/O port to HIGH).
Here is my code, and i hope u can help me...

Code:
int LM35 = A15;
int lm35Value = 0;
int output = 22;
float temp= 0;
unsigned long  tempHIT;


void setup() {
  Serial.begin(9600);
  pinMode(output, OUTPUT);
}

void loop() {

  if(CheckTemp() > 30){
    tempHIT = millis();

}

  if(millis() - tempHIT > 2UL*60UL*1000UL && CheckTemp() > 30) {
    Serial.println("HERE");
    
    digitalWrite(output, HIGH);

  }

  Serial.print("Ult_IM: ");
  Serial.println(tempHIT);

}


float CheckTemp(){

  lm35Value = analogRead(LM35);
  temp = (lm35Value *  0.4887585532746823069403714565);
  Serial.print("Temp:");
  Serial.println(temp);
  delay(1000);

  return temp;
}

Hope i can help me...
Gratz
Nesquick
2  Using Arduino / Displays / Re: Nokia LCD display shield question on: December 30, 2012, 04:47:52 pm



This is the results with Basic Functions example...
3  Using Arduino / Displays / Re: Nokia LCD display shield question on: December 30, 2012, 03:37:35 pm

I'm using EPSON...
I tried all option and the PHILLIPS ones doesn't work at all.

One more thing, the LCD works with:
//graphic.begin(0,0,0,EPSON); //Normal Epson
//graphic.begin(0,0,0,EPSON_4); //Normal Epson

But its mirrored and upside down.
 
4  Using Arduino / Displays / Re: Nokia LCD display shield question on: December 30, 2012, 02:26:25 pm
Hey Again...

I tried your library (gLCD) and do the same thing, and i don't understand why...
5  Using Arduino / Displays / Re: Nokia LCD display shield question on: December 30, 2012, 02:20:29 pm
Hey...

Thanks for your quick reply...

Im using ColorLCDShield.
6  Using Arduino / Displays / Re: Nokia LCD display shield question on: December 30, 2012, 02:15:39 pm
Hey Guys...

With this tutorial (Link) i put the LCD to work, however everything appears in mirror and upside down. How can I solve this problem?

Gratz
NesquickPT
Pages: [1]