mailus
Full Member level 4
- Joined
- Mar 6, 2012
- Messages
- 234
- Helped
- 7
- Reputation
- 16
- Reaction score
- 7
- Trophy points
- 1,308
- Location
- -
- Activity points
- 2,706
hi.,
i have difficulty in programming with delays and 7 segment display routines;
now my doubt is,
i have data(in bytes) in a variable, i need to check the location of bit(from byte mentioned) which is zero. then i need to display in a single seven segment display(1~8). here i use for loop and bit manipulation function to find the location,on the same time i need to display which location is zero.for this i use delay function in for loop.how to avoid this delay function in for loop and the same time display the output.
i put my coding here:
i looking for your reply.....
i have difficulty in programming with delays and 7 segment display routines;
now my doubt is,
i have data(in bytes) in a variable, i need to check the location of bit(from byte mentioned) which is zero. then i need to display in a single seven segment display(1~8). here i use for loop and bit manipulation function to find the location,on the same time i need to display which location is zero.for this i use delay function in for loop.how to avoid this delay function in for loop and the same time display the output.
i put my coding here:
Code:
if(curr_ipt != 0xff) //check input if any change, enter loop
{
for(i=0;i<=7;i++)
{
if((curr_ipt &(1<<i))==0) //for each value of i bit location is change to ith location
{ //if any particular bit is zero means enter
delay_ms(debounce); //debounce time
if((curr_ipt &(1<<i))==0) //check again if still bit 0
{
temp=i; //save the location i in temp variable
output_B(conv(temp+1)); //call function "conv" and display in the portB
delay_ms(time); //time for display the content
}
}
}
i looking for your reply.....