Professional Documents
Culture Documents
5 org 0H
loop:
acall rotate_f acall delay acall break acall delay acall rotate_b acall delay acall break
;Rotate motor forward ;Let the motor rotate ;Stop the motor ;Wait for some time ;Rotate motor backward ;Let the motor rotate ;Stop the motor
h1: sjmp h1
rotate_f: setb L293D_A clr L293D_B setb L293D_E ret ;Make Positive of motor 1 ;Make negative of motor 0 ;Enable to run the motor
rotate_b:
;Make positive of motor 0 ;Make negative of motor 1 ;Enable to run the motor
break: clr L293D_A clr L293D_B clr L293D_E ret ;Make Positive of motor 0 ;Make negative of motor 0 ;Disable the o/p
delay:
back: mov r6,# 0ffh back1: mov r5,#0ffh here: djnz r5, here djnz r6, back1 djnz r7, back ret END