Hi, I am new to programming, and I want to design a program code for a count up timer which is controlled by an external push button switch.. what are the necessary functions and definitions that must be seen in my program code?
All you need in the code is a variable to hold the counter value and a button code. The button code will have a debounce delay. When button is pressed and relesed then counter value will increment by one. You also need a way to display this vaue. You can use UART, LCD or 7 Segment Display to output the counter value.
All you need in the code is a variable to hold the counter value and a button code. The button code will have a debounce delay. When button is pressed and relesed then counter value will increment by one. You also need a way to display this vaue. You can use UART, LCD or 7 Segment Display to output the counter value.
First you should bring up your micro controller, i.e implement necessary system clock(with internal or external oscillator) & look in to necessary peripherals like GPIO, timer, UART, SPI etc...
Generally push button is connected to the GPIO, as per the GPIO input high/low you can implement your logic..