0% found this document useful (0 votes)
53 views1 page

Void Main Int I While

This code configures port B of a PIC microcontroller as an output and uses it to light up the segments of a 7-segment display to display the digits 0 through 6. It sets port B to the binary values corresponding to each digit's segments and delays for 3 seconds before moving to the next digit, repeating this digit display loop indefinitely.

Uploaded by

Harshal Ambatkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views1 page

Void Main Int I While

This code configures port B of a PIC microcontroller as an output and uses it to light up the segments of a 7-segment display to display the digits 0 through 6. It sets port B to the binary values corresponding to each digit's segments and delays for 3 seconds before moving to the next digit, repeating this digit display loop indefinitely.

Uploaded by

Harshal Ambatkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

D:\DTU\Sem 2\LAB\ESD\Experiments\7 seg\7seg.

c
#include <pic.h>
void main()
{
int i;
TRISB= 0;
while(1)
{
PORTB= 0x3F;
for(i=0; i<3000;
PORTB= 0x06;
for(i=0; i<3000;
PORTB= 0x5B;
for(i=0; i<3000;
PORTB= 0x4F;
for(i=0; i<3000;
PORTB= 0x66;
for(i=0; i<3000;
PORTB= 0x6D;
for(i=0; i<3000;
}
}

i++);
i++);
i++);
i++);
i++);
i++);

You might also like