Actually i m using adc0804 as input to port 1 and and i want to drive motor to another port according to adc input. But the problem is how to give condition in c Suppose that i have adc output 11001100, and i want to rotate motor to particular angle then i m giving conditio as folows:
if(P1==0xCC) { mmotor1(); }
In this i am not getting motor movement. Plzzz tell me the right if condition.
if( P1 == 0xCC )
As far as 'C' language syntax goes, it is perfectly valid.
Whether it correctly implements what you're trying to achieve is an entirely different matter!
You haven't said what specific ship you're using.
You haven't shown your definition of P1.
You haven't said what the "magic number" 0xCC is supposed to represent.
"suppose i am getting adc output 11001100"
Why "suppose" it? Is it actually happening??