Does any body knows,how should i display some digit on seven segment? for example by pressing a push bottom which is connected to "p1.18" port of "lpc2124", digit "1" appears on the seven segment,or by pressing a push bottom connected to "p1.16",digit "2" appers on seven segment.
Separate the problem into sub-problems.
1) Decide what stimuli to use to select digit. Maybe 10 processor pins - one for each digit. But then you have to decide what to do if multiple pins are activated. Or maybe four processor pins detecting a binary combination. But then you need to decide what you should do if combination 10..15 are selected. Or maybe connect a potentiometer to an ADC and measure the turn angle.
2) Figure out what type of display you want to use. Common-anode or common-cathode determines how you drive them. Should you short a pin to ground to light one segment? More processors are good at sinking current than sourcing current. Next thing - can the processor handle all 7 segments concurrently without overload? Using a digit module or using 7 or more discrete LED?
3) Test the software modules individually.
4) Modify the code by having the input from the input select the action for the driver module.
View all questions in Keil forum