Noob - pushbutton Debounce and State Change problm

Hi all, Just got my arduino yesterday. made a cool program (for a beginner) but it looks like i need to get debouncing and state changing handled properly.

so for this experiment i have one pushbutton switch hooked up to the arduino. no resistors. one lead goes to 12. the other to 8.

please see the following code. upon init "OINK" is printed once, or a few times. I desire to see OINK printed ONCE each time i press the button. please help!

//declare constants
#define BUTTON1 8
#define POWER1 12

//declare variables
int buttonState1 = LOW;
int buttonValue1 = 0;

int transInt = 50;
int lastButtonUpTime = 0;

void setup(){
  //set pins
  pinMode(BUTTON1, INPUT);
  pinMode(POWER1, OUTPUT);
  digitalWrite(POWER1, HIGH);

void loop(){
  //read button pins
  buttonValue1 = digitalRead(BUTTON1);
  //handle button1 behaviour - turn LED off and on
  if((buttonValue1 == HIGH) && (buttonState1 != buttonValue1)){
    if(millis() - lastButtonUpTime > transInt){
      lastButtonUpTime = millis();
  buttonState1 = buttonValue1;

many thanks, marco.

ive also found, just now, that just moving the set up around makes the trigger fire. what is going on?

what is going on?

You are not enabling the pull up resistor on the button input (again)