void Encoder (void)
{
int new = 0 ;
int value = 0 ;
new = PORTE ;
value = new ^ old ;
if(value & 0x08)
{
if (new & 0x08)
{
mstepperAena() ; //stepper enable
if (new & 0x04)
{
mstepperAfor() ; //stepper forward
}
else
{
mstepperArev() ; //stepper reverse
}
mstepperAhalf(); // stepper half step means 1 step is 0.9 degree of stepper motor
mstepperAoff(); // stepper off
Delay(20);
mstepperAon(); //stepper on
}
}
stepperAquater();
stepperAquater();
stepperAeighth();
stepperAeighth();
stepperAeighth();
stepperAeighth();
#define MS_1 BIT_1
#define MS_2 BIT_2
#define stepperAquater() (LATBSET = MS_1 , LATBCLR = MS_2 )
#define stepperAeighth() (LATBSET = MS_1 , LATBSET = MS_2 )
#define stepperAhalf() (LATBCLR = MS_1 , LATBSET = MS_2 )
mstepperAhalf(); // stepper half step means 1 step is 0.9 degree of stepper motor
mstepperAoff(); // stepper off
Delay(20);
mstepperAon(); //stepper on
mstepperAhalf(); // stepper half step means 1 step is 0.9 degree of stepper motor
mstepperAoff(); // stepper off
Delay(20);
mstepperAon(); //stepper on
mstepperAoff(); // stepper off
Delay(20);
mstepperAon(); //stepper on
Code:mstepperAhalf(); // stepper half step means 1 step is 0.9 degree of stepper motor mstepperAoff(); // stepper off Delay(20); mstepperAon(); //stepper on mstepperAoff(); // stepper off Delay(20); mstepperAon(); //stepper on
is two 1/2 steps ?
mstepperAhalf(); // stepper half step means 1 step is 0.9 degree of stepper motor
mstepperAoff(); // stepper off
Delay(20);
mstepperAon(); //stepper on
[B]Delay(20);[/B]
mstepperAoff(); // stepper off
Delay(20);
mstepperAon(); //stepper on
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?