Introduction: Arduino Simple Debounce
This instructable is about how to make easy debounce with 2 push buttons.All you need is basic knowledge in electronics and arduino programming.
If you have any questions or problems you can contact me on my mail:firstname.lastname@example.org
So let's begin.
Step 1: Materials
Everything you need for this project you can get on ebay or amazon.
-2 push buttons
-Arduino Mega 2560 or Uno
-2 LED´s(green and red) if you want you can choose other colors
-two 10k ohm resistors
-and of course computer.
Step 2: Watch a Video
You can also see how this project is working
Step 3: Wiring
This project is very easy to connect because there isnt a lot of electronics components.
-push button (ON) is connected to digital pin 2
-push button (OFF) is connected to digital pin 3
-green LED is connected to digital pin 5
-red LED is connected to digital pin 4
You just need to be careful that you connect 10k ohm resistors between GND and push button pin.(look circuit picture)
Step 4: Code
This code is very easy to make and understand.
It is working like that.
-When you hit ON push button, variable x state change to 1, stays there until you hit OFF button and green LED turn on.
-When you hit OFF push button, variable x state change back to 0, stays there until you hit ON button again and red LED turn on.
Just download it, plug in Arduino and upload code.