Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LPC2148 Code help for 7 segment

Status
Not open for further replies.

amayilsamy

Advanced Member level 1
Advanced Member level 1
Joined
Feb 5, 2013
Messages
420
Helped
38
Reputation
76
Reaction score
34
Trophy points
1,308
Location
Chennai,India
Visit site
Activity points
3,370
I need code for 00 to 99 counter code for 7 segment.


I try it. but I can't get Correct output

Thanks in advance
 

7seg.JPG
I need code for 00 to 99 counter code for 7 segment.


I try it. but I can't get Correct output

Thanks in advance

I am getting the 7 segment in simulation from 0 to 9

#include <LPC214x.h>
void DelayMs(unsigned int count);
unsigned char seg[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};//hex values for 0 to 9
int main(void)
{
PINSEL0 |= 0x00000000;// setting the pins as GPIO
IO0DIR |= 0x000000ff; // setting the pins as output
while(1)
{ unsigned int k;
for(k=0;k<9;k++)
{
IOSET0 |=seg[k];
DelayMs(500);
IOCLR0 |=seg[k];

}
}}

void DelayMs(unsigned int count)
{
unsigned int i,j;
for(i=0;i<count;i++)
{
for(j=0;j<3000;j++);
}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top