two button debounce

First, download this library

The sketch:

#include <EdgeDebounceLite.h>
EdgeDebounceLite debounce;

const int buton1 = 2;
const int buton2 = 3;
const int led1 = 4;
const int led2 = 5;
const int led3 = 6;

void setup() {
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
}

void loop() {
  if (debounce.pin(button1) digitalWrite(led1, HIGH);
  else                      digitalWrite(led1, LOW);

  if (debounce.pin(button2) digitalWrite(led2, HIGH);
  else                      digitalWrite(led2, LOW);
}

Jacques