Hello!
1. First you might want to understand how a stepper works.
Inyour code, P2 has 2 states only, 0x0C and 0x03. This cannot work.
Looking at the schematic, it looks like it's a unipolar motor. You have
to power the windings in the right sequence, which is unlikely to be 0x03 / 0x0C.
2. If you want to move by 90 degrees, you should have this variable somewhere.
I use 400 steps motors, which means that 90 degrees is 100 steps. I would expect
some definition like this somewhere in the program:
#define STEPS_PER_TURN 400 // Adapt to your motor.
3. Your value 'zin' will never update. It is defined forever at the beginning of the program.
You have to at least read port 0 in your loop. Same for zout.
4. You don't use the delay function.
5. Your num variable is never used.
6. You might want to learn about timers and interrupts. But for a first run, try to
run your motor at constant speed, and then think about the possible evolutions.
Can you any one give me proper Program for that :
What is the point of getting your program done by somebody else. Are you that bored by
technology?
Dora.