Pages: [1]   Go Down
Author Topic: error  (Read 174 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey want somebody who is good at every moment and throw an eye and tell you what I have gort wrong. Sincerely Tobias

int moistureSensorPin = 1;
int pumpPin = 5;
int pumpLEDPin = 3;

// variables
int moistureSensorValue;


void setup(){
pinMode(pumpLEDPin, OUTPUT);
pinMode(pumpPin,OUTPUT);
}

void loop()
{
  moistureSensorValue = analogRead(moistureSensorPin);
  if(moistureSensorValue >= 700)
    delay(5000);
    digitalWrite(pumpPin,LOW);}
 {
   if((moistureSensorValue < 700) && (moistureSensorValue >= 300)){
      delay(5000);
      digitalWrite(pumpPin,HIGH);
      delay(6000);
    }
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26488
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Didn't the compiler tell you?

Use code tags.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

UK
Offline Offline
Tesla Member
***
Karma: 135
Posts: 7673
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why do you think there is something wrong?

...R
Logged

East Anglia (UK)
Online Online
Faraday Member
**
Karma: 118
Posts: 4333
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try Auto Format in the IDE and it will give you a clue as to what is wrong.  Then examine every pair of curly braces and make sure that there is always a pair, not an odd one, and that the start and end braces are in the right place.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Pages: [1]   Go Up
Jump to: