software debounce on my button state

 //Swap Page Loop
     nextcase = digitalRead(13);
     if (nextcase != oldcase)
      { 
        state++;
       lcd.clear();
      }  
      if (state > 4)
      {
        state = 0;
      }
      
      b1new = digitalRead(9);
      Serial.println(rone);
       if (b1new != b1old)
       {
         rone++;
       } 
       if (rone > 1)
       {
         rone = 0;
       }

I am looking into adding sofwtare debounce to my code and comparing what I have to the arduino reference material. Can i use my b1new, b1old, rone++ in place of the reading, currentstate, counter variables. If so how do i build the millis time part in?
http://playground.arduino.cc/Learning/SoftwareDebounce
I also tried to do a hardware debounce with a .1mF capacitor and 10k resistor but it did not work consistently.
Used this page for schematic: Digitalduino: Arduino Software and Hardware Based Button Debouncing
Any help would be greatly appreciated.

The most basic debounce is blocking but it may work for you.

Read the switch and save the state
delay for a brief time
Compare the saved state with the current state
If they are the same your button is debounced and you can use the result.

Assuming that you are using the variable b1new for your button state (not a very good name) it might look like this

  b1new = digitalRead(9);  // you should use a constant for pin numbers
  delay(20) // pause briefly (I should really use a constant here)
  // now see if the reading is the same
  if (b1new ==  digitalRead(9))  // if they are equal it has cleared debouncing
  {
      Serial.println(rone);
       if (b1new != b1old)
       {
         rone++;
       } 
       if (rone > 1)
       {
         rone = 0;
       }
   }

Making it non-blocking will depend a lot on the rest of your code which you haven't shown.

b1new = digitalRead(9); // you should use a constant for pin numbers So 9 needs to be some const int = xxx?

delay(20) // pause briefly (I should really use a constant here) My buttons are momentary is that a good delay or should increase/decrease?
What const int should i sure for delay?

What const int should i sure for delay?

Anything you like. Maybe call it debounceDelay but it does not matter. The point about it being a const with a name is that it cannot be easily changed by accident by the program, its name will give a clue as to what it is doing and it is easy to change it throughout the program by simply changing the value of the const.

so if i put something like:
const int delaydbounce = delay(20)

i can then just right delaydbounce; instead of delay(20) everytime?

b1new = digitalRead(9); // you should use a constant for pin numbers

How should i handle this cause i thought pinMode(9, OUTPUT) took care of that.

well i want to say thanks for helping me it works great now. ill research the const int for by input output buttons. Agian thanks

const int bounceDelay = 20;

as a global variable, then anywhere in your code

delay(bounceDelay);

As to the digitalReadconst byte inputPin = 9;as a global variable then anywhere in your codeb1new = digitalRead(inputPin);makes it more obvious as to what is being read and it is easier to change the pin number if, for instance, you later need or decide to change the pin allocations.

Use your own variable names to suit your application but it makes sense for them to be meaningful and helps make the code self documenting.