0

Hi I'm new at this and can't figure out why I get this error "void does not name a type" on lines 3,5,8,26

// _2-5 set Debounce Button
const int BUTTON=2;
const int LED=9;
boolean lastButton = LOW;
boolean currentButton = LOW;
boolean ledOn = false;

Void setup()
{
  pinMode (LED, OUTPUT);
  pinMode (BUTTON, INPUT);
}

boolean debounce(boolean last)

{ 
  boolean current = digitalRead(BUTTON);
  if (last != current)
  {
    delay(5);
    current = digitalRead(BUTTON);
  }
  return current;
}

Void loop()
{
  currentButton = debounce(lastButton);
  if (lastButton == LOW && currentButton == HIGH)
  {
    ledOn = !ledOn;
  } 

  lastButton = currentButton;
  digitalWrite(LED, ledOn);

}

migrated from electronics.stackexchange.com Dec 19 '14 at 1:15

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

6

I thing the problem is not "void does not name a type", but "Void does not name a type". Subtle difference:

Void setup()

should read:

void setup()

The same on

Void loop()

should be

void loop()

Watch those caps - C is case sensitive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy