-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhard_code.s
More file actions
41 lines (41 loc) · 926 Bytes
/
Copy pathhard_code.s
File metadata and controls
41 lines (41 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
app_finish:
lw $t5, side
beq $t5, 1, right_side_moving
left_side_moving:
li $t5, 10
sw $t5, VELOCITY
lw $t6,BOT_Y
blt $t6,55,left_side_moving
li $t7,-90
sw $t7,ANGLE($zero)
sw $zero,ANGLE_CONTROL($zero)
keep_moving_left:
li $t5, 10
sw $t5, VELOCITY
lw $t6,BOT_X
blt $t6,30,keep_moving_left
li $t7,0
sw $t7, VELOCITY
li $a0, 150
li $a1, 200
jal findAngle
j infinite
right_side_moving:
li $t5, 10
sw $t5, VELOCITY
lw $t6, BOT_Y
blt $t6,55,right_side_moving
li $t7,180
sw $t7,ANGLE($zero)
li $t7, 1
sw $t7,ANGLE_CONTROL($zero)
keep_moving_right:
li $t5, 10
sw $t5, VELOCITY
lw $t6,BOT_X
bgt $t6, 270, keep_moving_right
li $t7,0
sw $t7, VELOCITY
li $a0, 150
li $a1, 200
jal findAngle