This is the code that we have used.. but it is not working.. the motor is moving very slowly and not at all according to the way we want it to.. i.e .. its not following the code. very erratic movement.
#include<avr/io.h>
#include<util/delay.h>
main()
{
DDRA|=((1<<PORTA0)|(1<<PORTA1)|(1<<PORTA2)|(1<<PORTA3));
while(1)
{
PORTA=0b00000101;
_delay_ms(100);
PORTA=0b00001010;
_delay_ms(100);
PORTA=0b00001000;
_delay_ms(100);
PORTA=0b00000010;
_delay_ms(100);
}
}
what changes must we make.. thank you
#include<avr/io.h>
#include<util/delay.h>
main()
{
DDRA|=((1<<PORTA0)|(1<<PORTA1)|(1<<PORTA2)|(1<<PORTA3));
while(1)
{
PORTA=0b00000101;
_delay_ms(100);
PORTA=0b00001010;
_delay_ms(100);
PORTA=0b00001000;
_delay_ms(100);
PORTA=0b00000010;
_delay_ms(100);
}
}
what changes must we make.. thank you