#include
#include
#define F_CPU 800000UL
#include
void main()
{
DDRD = 0xFF;
PORTD = 0x00;
while(1)
{
//half stepping mode
/*PORTD = 0x0C;
_delay_ms(30);
PORTD = 0x06;
_delay_ms(30);
PORTD = 0x03;
_delay_ms(30);
PORTD = 0x09;
_delay_ms(30);*/
//full torque mode
PORTD = 0x08;
_delay_ms(50);
PORTD = 0x0C;
_delay_ms(50);
PORTD = 0x04;
_delay_ms(50);
PORTD = 0x06;
_delay_ms(50);
PORTD = 0x02;
_delay_ms(50);
PORTD = 0x03;
_delay_ms(50);
PORTD = 0x01;
_delay_ms(50);
PORTD = 0x09;
_delay_ms(50);
}
}
#include
#define F_CPU 800000UL
#include
void main()
{
DDRD = 0xFF;
PORTD = 0x00;
while(1)
{
//half stepping mode
/*PORTD = 0x0C;
_delay_ms(30);
PORTD = 0x06;
_delay_ms(30);
PORTD = 0x03;
_delay_ms(30);
PORTD = 0x09;
_delay_ms(30);*/
//full torque mode
PORTD = 0x08;
_delay_ms(50);
PORTD = 0x0C;
_delay_ms(50);
PORTD = 0x04;
_delay_ms(50);
PORTD = 0x06;
_delay_ms(50);
PORTD = 0x02;
_delay_ms(50);
PORTD = 0x03;
_delay_ms(50);
PORTD = 0x01;
_delay_ms(50);
PORTD = 0x09;
_delay_ms(50);
}
}
No comments:
Post a Comment