LPC2148 Code help for 7 segment

Status
Not open for further replies.

amayilsamy

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
 

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

Cookies are required to use this site. You must accept them to continue using the site. Learn more…