Sign In

Trouble In Implemention Multiplexed 7segment

Rohit singh rohitsingh2410@gmail.com India

Hardware: Atmega 16 Running On Avr Studio Software: Avr Studio 4

i'm trying to make a traffic light controller , but the problem is the seven sement siplay shows nothin it even doesn't starts.

Images

Trouble in implemention multiplexed 7segment

Program

#include<avr/io.h>
#include<util/delay.h>
void main()
{
int k, i,a[]={0x3f,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67};
DDRA=0xff;
DDRC=0x03;
DDRD=0x07;
while(1)
{ PORTD = 0x01; //red//
for(i=0;i<=10;i++)
 {
for(k=0;k<25;k++)
  {
PORTC = 0x02;
PORTA= a[i/10];
_delay_ms(1000);

PORTC=0x01;
PORTA=a[i%10];
_delay_ms(1000);

  }
 }

PORTD = 0x02; //yellow//
for(i=0;i<=10;i++)
 {
for(k=0;k<25;k++)
  {
PORTC = 0x02;
PORTA= a[i/10];
_delay_ms(1000);

PORTC=0x01;
PORTA=a[i%10];
_delay_ms(1000);

  }
 }PORTD = 0x03; // green //
for(i=0;i<=20;i++)
 {
for(k=0;k<25;k++)
  {
PORTC = 0x02;
PORTA= a[i/10];
_delay_ms(1000);

PORTC=0x01;
PORTA=a[i%10];
_delay_ms(1000);

  }
 }
}
}

Replies

R Avinash Ofc PC
2017-07-03 06:42:46
From where you have got this code?
R Rohit singh
2017-07-03 11:43:19
I've written why?
R Avinash Ofc PC
2017-07-04 04:30:36
What does the display show when run?

Post a reply to Rohit singh

Think you can help Rohit singh ? Then post your thoughts that might help Rohit singh. You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.