<p>Now I can use the makefile for any file I want instead of the predefined filename by adding <code>filename = your file name</code> after <code>make program</code> and <code>make flash</code> like this <code>make program filename = program.c</code></p>
<p>Now I can use the makefile for any file I want instead of the predefined filename by adding <code>filename = your file name</code> after <code>make program</code> and <code>make flash</code> like this <code>make program filename = program.c</code></p>
<h4id="pull-up-resistor">Pull-up resistor</h4>
<h4id="pull-up-resistor">Pull-up resistor</h4>
<p>Pull up resistor is a piece of hardware used to ensure that the inputs settle at the logical level (0 or 1). Just because the input pin is not connected to anything, the pin reads a constant state like 0. For example, the previous project is about controlling an LED when the button is pressed. If I have not used the internal pull up resistor, the LED will be switched on and off several times without me pressing the button !</p>
<p>Pull up resistor is basically a 5 volt source connected in series with a resistor. The resistor is connected to the input pin and the switch (in my case the button). The button is connected to the ground.</p>
<p>When the pull up resistor is initiated, the pin will read 1 (5v). If the button is pressed the resistor will be connected with the ground and the pin will read 0.</p>
<h4id="button-debouncing">Button debouncing</h4>
<h4id="button-debouncing">Button debouncing</h4>
<p>A major problem with buttons is the switch bounce, which appears when pressing the button (changing the state). Button bounce is a design problem and it is effect depends on the quality of the switch. When a button is pressed, the state will be changed from 0 to 1 or from 1 to 0, actually this change is not happening instantly, the state will be changed several times before it becomes stable at the new state. The microcontroller will think that the button has been pressed several times, but we have pressed it only once !</p>
<p>A major problem with buttons is the switch bounce, which appears when pressing the button (changing the state). Button bounce is a design problem and it is effect depends on the quality of the switch. When a button is pressed, the state will be changed from 0 to 1 or from 1 to 0, actually this change is not happening instantly, the state will be changed several times before it becomes stable at the new state. The microcontroller will think that the button has been pressed several times, but we have pressed it only once !</p>
<p>I have used the oscilloscope to view the bouncing effect of the button I used in the board.</p>
<p>I have used the oscilloscope to view the bouncing effect of the button I used in the board.</p>
@@ -247,6 +247,12 @@ Now I can use the makefile for any file I want instead of the predefined filenam
...
@@ -247,6 +247,12 @@ Now I can use the makefile for any file I want instead of the predefined filenam
#### Pull-up resistor
#### Pull-up resistor
Pull up resistor is a piece of hardware used to ensure that the inputs settle at the logical level (0 or 1). Just because the input pin is not connected to anything, the pin reads a constant state like 0. For example, the previous project is about controlling an LED when the button is pressed. If I have not used the internal pull up resistor, the LED will be switched on and off several times without me pressing the button !
Pull up resistor is basically a 5 volt source connected in series with a resistor. The resistor is connected to the input pin and the switch (in my case the button). The button is connected to the ground.
When the pull up resistor is initiated, the pin will read 1 (5v). If the button is pressed the resistor will be connected with the ground and the pin will read 0.
#### Button debouncing
#### Button debouncing
A major problem with buttons is the switch bounce, which appears when pressing the button (changing the state). Button bounce is a design problem and it is effect depends on the quality of the switch. When a button is pressed, the state will be changed from 0 to 1 or from 1 to 0, actually this change is not happening instantly, the state will be changed several times before it becomes stable at the new state. The microcontroller will think that the button has been pressed several times, but we have pressed it only once !
A major problem with buttons is the switch bounce, which appears when pressing the button (changing the state). Button bounce is a design problem and it is effect depends on the quality of the switch. When a button is pressed, the state will be changed from 0 to 1 or from 1 to 0, actually this change is not happening instantly, the state will be changed several times before it becomes stable at the new state. The microcontroller will think that the button has been pressed several times, but we have pressed it only once !