yes , i am using 4 sensors on oneside and 4 sensors on otherside, so its bidirectional isnt it ?[/COLOR]As i sense, you are trying to do unidirectional arrangement. it will be better if you do bidirectional
you referred the LDR only for cost reduction isnt it ?, i misread as it using as a direction sensorso expensive but you can reduce them using LDR
varunme said:eg :1
input port : Portc= 10010000
Outputport: Portd= 11111100
eg :2
input port : Portc= 10001000
Outputport: Portd= 11101110
varunme said:making one adjescent bit high is also handy helping
unsigned char i;
volatile unsigned char port_C = PORTC; //save PORTC
volatile unsigned char port_D = 0; //init variable
for(i = 0; i < 8; i++)
{
if (port_C&(1<<i))
{
port_D |= (1<<i);
if (i)
port_D |= (1<<(i-1));
}
}
PORTD = port_D; //update PORTD
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?