A Ajax12 New Member Jan 18, 2011 #1 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
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
W wkrug Active Member Jan 18, 2011 #2 You have written 1<<POR TA3 instead of 1<<PORTA3. Is that the Problem? Is the Sequence for Motor Drivers OK ( 0101 - 1010 - 1000 - 0010 ) ?
You have written 1<<POR TA3 instead of 1<<PORTA3. Is that the Problem? Is the Sequence for Motor Drivers OK ( 0101 - 1010 - 1000 - 0010 ) ?
Sceadwian Banned Jan 19, 2011 #3 You should really take a look at your own code BEFORE you post it asking other people for help =) I'm surprised that compiled without warnings.
You should really take a look at your own code BEFORE you post it asking other people for help =) I'm surprised that compiled without warnings.