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);

}

1 Answer 1

7

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 and acknowledge that you have read and understand our privacy policy and code of conduct.