Want C code

Thread Starter

laxmi

Joined Jun 19, 2009
14
plz send me the details of visitor cum token number display +pic 16f877/877a.

to my mail id <snip>
thanks in advance.
 
Last edited by a moderator:

Papabravo

Joined Feb 24, 2006
21,225
c code for 00-99 number display using 7 segment led+pic
Would you like working code, or can there be a specified number of bugs that you have to find for yourself? You need to show some industry here. Wire me $995 for working code and $1.98 for code with 10 bugs you need to fix.
 

steinar96

Joined Apr 18, 2009
239
laxmi. It's highly unlikely that your request will be granted. This forum isnt about asking for something which could involve alot of work and just get the fully designed thing right into your hand. That is what paid engineers and software programmers do.

This forum revolves around peer groups in different and interactive fields of electronics, programming and circuitry. It's about learning and assistance. If you start programming this yourself, or ask for help on how to start you will recieve it. You will not however, most likely recieve a complete product involving hours of work right into your hands at request unless it's very "google'able" (which means you could have found it by yourself with some searching).
 

Thread Starter

laxmi

Joined Jun 19, 2009
14
Thanks and sorry for the delay. I got the output what i need . Actually i got some problem during decremt n incrementing the counter. so i asked.

Thanks,
Laxmi
 

Thread Starter

laxmi

Joined Jun 19, 2009
14
visitor counter cum token number display

Hello Sir/Madam,

As im doing this project using pic-16f877a microcontroller.

concept of output: i need to display number of persons enter as well as using sensor and also token number display .

in main program i wrote code of visitor & in interrupt service routine i wrote code of token display.

for visitor -00-99 display
for token display- max_size of array we can store is 25.
main-program:

Note :in this code as im using single controller so i used for 7-segment display PORTA & RE0(g) for token & PORTD for VISITOR.
while(1)
{

/*for up-counter 00-99*/
if(IN_SENSOR)
{

while(IN_SENSOR)
{
continue;
}

DelayMs(50); // Delay for debounce

if(count<=99)
{
count++;
display_number_both_tens_unit(count);
}

}
else
{ /* for Down-counter*/
if(OUT_SENSOR)
{
while(OUT_SENSOR)
{
continue;
}

DelayMs(50); // Delay for Debounce
count--;
display_number_both_tens_unit(count);
}
}
} //End of while


isr:
static void interrupt
isr(void)
{
if(RCIF&& RCIE)
{
if(arr_ptr<max_size)
{
num1=getch();
num2=getch();
read_value=(((num1*10)+num2)-16);
input_arr[arr_ptr]=read_value;
arr_ptr++;

if(arr_ptr==max_size)
{
putch(' ');
putch('A');
putch('F');
putch('F');
}
}
//RCIF=0;
}
else if(INTE&&INTF)
{
int_ptr=0;
tens_place=((input_arr[int_ptr])/10);
unit_place=((input_arr[int_ptr])%10);
putch(' ');
putch('A');
putch(tens_place|0x30);
putch(unit_place|0x30);
if((RB0)==1) // here im gettin problem if i use if statement the result is unit_place is same as tens_place . if use while(RB0) this will be interrupt only means not possible to go main program as visitor counter
{

if(tens_place ==1)
{
g=1;
}
else if(tens_place == 0)
{
g=1;
}
else if(tens_place==7)
{
g=1;
}
else
{
g=0;
}

TOKEN_DISPLAY=Display(tens_place);
DIGIT1_tens_token=0; //Enabling DIGIT1_tens
DelayMs(2); //wait for few milliseconds
DIGIT1_tens_token=1; //Disabling DIGIT1_tens

if(unit_place == 1)
{
g=1;
}
else if(unit_place == 0)
{
g=1;
}
else if(unit_place == 7)
{
g=1;
}
else
{
g=0;
}

TOKEN_DISPLAY=Display(unit_place);
DIGIT2_unit_token=0; //Enabling DIGIT2_unit
DelayMs(2); //wait for few milliseconds
DIGIT2_unit_token=1; //Disabling DIGIT2_unit
}

for(j=0; j<max_size; j++)
{
input_arr[j]=input_arr[j+1];
}
arr_ptr--;
INTF=0;
}

Please Help me out.

Thanks in advance.
 
Top