Professional Documents
Culture Documents
This 68000 microcontroller based system is designed for the robot to move left and right when the sensors detect the inputs and move backwards when limit switch is activated upon touching obstacle. Otherwise it will move forward. It will stop moving once it reaches the end of the route. At the route end, there is a colored line that will be detected by color sensor.
PROGRAM CODES: ORG EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU $8100 $8000 $8010 $8020 $8030 $8040 $8050 $8060 $8070 $8080 $8090
MOVEFWD
; move the forward data to D1 ; robots moves forward ; move the right data to D1 ; move sensor1 output to D2 ; compare D1 and D2 ; if equal, move data to motor
TURNRIGHT
; move sensor2 output to D4 ; compare D3 and D4 ; if equal, if equal, move data to motor ; robot moves to the left
MOVE.L
D4, MOTOR
MOVEBWD
LS, D5 #1, D6 D5, D6 MOVEBWD D6, MOTOR S3, D7 #1, STOP D7, STOP STOPM
; move the limit switch output to D5 ; move the backward data to D6 ; compare D5 and D6 ; if equal, move backwards ; robot moves backward ; move the sensor3 output to D7 ; assign #1 to stop data ; compare D7 & stop data ; if equal, motor stop
STOPM
RTS END