7ezhil7
Junior Member level 2
Hi,
I need to reuse a function to use sensors at different pins of pic16f877a. For that I assigned binary value to a variable.I passed that variable as argument to the function which has to be reused.Then I shifted that variable and passed it as argument to same function.
I don't know what data type to use for that binary variable.Also I need to know whether this method works good for code reusablity..Please help .....Thanks in advance...
I need to reuse a function to use sensors at different pins of pic16f877a. For that I assigned binary value to a variable.I passed that variable as argument to the function which has to be reused.Then I shifted that variable and passed it as argument to same function.
I don't know what data type to use for that binary variable.Also I need to know whether this method works good for code reusablity..Please help .....Thanks in advance...
Code:
v=0b11;
temp(v);
v=v<<1;
temp(v);
....
void temp(v)
{
TRISE=v;
PORTE=1;
.....}