alexxx
Advanced Member level 4
That's a strange behaviour... The motor should spin only when D0=D1=1 and D2=0. At any other case it should stop. If this is not the behaviour, then something else is wrong. Of course it could be improved, but you must be sure first. Did you debug the code?
1) Which breakpoint is hit after reset?
2) Which breakpoint is hit when you connect D2 to ground?
PS: Don't forget the PORTD |= 7; command before while (1), to make the pull up resistors.
1) Which breakpoint is hit after reset?
2) Which breakpoint is hit when you connect D2 to ground?
PS: Don't forget the PORTD |= 7; command before while (1), to make the pull up resistors.