Your sketch looks like it is taken from the Debounce example IDE >> FILES >> EXAMPLES >> 02.DIGITAL >> DEBOUNCE... but for that example to work, the button needs to be normally tied LOW, and when pressed results in a HIGH. You are probably seeing "pressed" because your button pin is tied HIGH.
if you want to use millis() instead of a simple delay(), consider the following
buttons are typically connected between the pin and ground, the pin configured as INPUT_PULLUP to use the internal pullup resistor which pulls the pin HIGH and when pressed, the button pulls the pin LOW.
a button press can be recognized by detecting a change in state and becoming LOW
// check multiple buttons and toggle LEDs
const byte PinLeds [] = { 10, 11, 12 };
const byte PinButs [] = { A1, A2, A3 };
const int Nbut = sizeof(PinButs);
byte butState [Nbut];
unsigned long msecButs [Nbut];
const unsigned long DebounceMsec = 20;
// -----------------------------------------------------------------------------
#define DebounceMsec 10
int
chkButtons ()
{
unsigned long msec = millis ();
for (unsigned n = 0; n < sizeof(PinButs); n++) {
if (msecButs [n] && (msec - msecButs [n]) < DebounceMsec)
continue;
msecButs [n] = 0;
byte but = digitalRead (PinButs [n]);
if (butState [n] != but) {
butState [n] = but;
msecButs [n] = msec ? msec : 1; // make sure non-zero
if (LOW == but)
return n;
}
}
return -1;
}
// -----------------------------------------------------------------------------
void
loop ()
{
switch (chkButtons ()) {
case 2:
digitalWrite (PinLeds [2], ! digitalRead (PinLeds [2]));
break;
case 1:
digitalWrite (PinLeds [1], ! digitalRead (PinLeds [1]));
break;
case 0:
digitalWrite (PinLeds [0], ! digitalRead (PinLeds [0]));
break;
}
}
// -----------------------------------------------------------------------------
void
setup ()
{
Serial.begin (9600);
for (unsigned n = 0; n < sizeof(PinButs); n++) {
pinMode (PinButs [n], INPUT_PULLUP);
butState [n] = digitalRead (PinButs [n]);
}
for (unsigned n = 0; n < sizeof(PinLeds); n++) {
digitalWrite (PinLeds [n], HIGH); // off
pinMode (PinLeds [n], OUTPUT);
}
}