Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. alias Dish d0
  2. alias ScanSwitch d1
  3. alias IgnoreSwitch d2
  4.  
  5. alias IsEnable r0
  6. alias IsIgnore r1
  7. alias Axis r2
  8. alias Id r3
  9. alias Power r4
  10. alias Horiz r5
  11. alias Vert r6
  12. alias Step r7
  13. alias Direction r8
  14. alias LastPower r9
  15. alias Temp r10
  16. alias IgnoreId1 r11
  17. alias IgnoreId2 r12
  18. alias IgnoreId3 r13
  19. alias IgnoreId4 r14
  20. alias IgnoreId5 r15
  21.  
  22. Reset:
  23. move Axis 0
  24. move Id 0
  25. move Power 0
  26. move Step 4
  27. move Direction 1
  28. move LastPower 0
  29. move IgnoreId1 0
  30. move IgnoreId2 0
  31. move IgnoreId3 0
  32. move IgnoreId4 0
  33. move IgnoreId5 0
  34. s Dish Horizontal Horiz
  35. s Dish Vertical Vert
  36.  
  37. Main:
  38. jal CheckSwitches
  39. jal ReadValues
  40. beqz IsEnable Reset
  41. beqzal IsIgnore Ignore
  42. beqz Id Searching
  43. beq Id IgnoreId1 Searching
  44. beq Id IgnoreId2 Searching
  45. beq Id IgnoreId3 Searching
  46. beq Id IgnoreId4 Searching
  47. beq Id IgnoreId5 Searching
  48.  
  49. Homing:
  50. brge Power LastPower 3 #If Current < Last
  51. div Step Step 2
  52. mul Direction Direction -1 #End If
  53. brlt Power LastPower 4 #If Current > Last
  54. brge Step 1 3 #And If Step < 1
  55. nor Axis Axis Axis
  56. move Step 4 #End If
  57. sub Temp 1 Power
  58. mul Temp Temp 30 #Max step 3deg/90% or 1.5deg/95%
  59. min Step Step Temp
  60. mul Temp Direction Step
  61. move LastPower Power
  62. beqz Axis HomeHorizontal
  63.  
  64. HomeVertical:
  65. add Vert Vert Temp
  66. brlt Vert 89 3 #If Vert > 89
  67. move Vert 90
  68. nor Axis Axis Axis #End If
  69. brgt Vert 1 3 #If Vert < 1
  70. move Vert 0
  71. nor Axis Axis Axis #End If
  72. s Dish Vertical Vert
  73. j Main
  74.  
  75. HomeHorizontal:
  76. add Horiz Horiz Temp
  77. brlt Horiz 359 3 #If Horiz > 359
  78. move Horiz 360
  79. nor Axis Axis Axis #End If
  80. brgt Horiz 1 3 #If Horiz < 1
  81. move Horiz 0
  82. nor Axis Axis Axis #End If
  83. s Dish Horizontal Horiz
  84. j Main
  85.  
  86. Searching:
  87. move Axis 0
  88. move Step 4
  89. move Power 0
  90. move LastPower 0
  91. brlt Horiz 359 2 #If Horiz > 359
  92. move Direction -1 #End If
  93. brgt Horiz 1 2 #If Horiz < 1
  94. move Direction 1 #End If
  95. mul Horiz Direction 180
  96. add Horiz Horiz 180
  97. mul Vert Direction 15
  98. add Vert Vert 45
  99. s Dish Horizontal Horiz
  100. s Dish Vertical Vert
  101. j Main
  102.  
  103. CheckSwitches:
  104. l IsEnable ScanSwitch Setting
  105. l IsIgnore IgnoreSwitch Setting
  106. j ra
  107.  
  108. ReadValues:
  109. l Id Dish SignalID
  110. l Power Dish SignalStrength
  111. l Horiz Dish Horizontal
  112. l Vert Dish Vertical
  113. j ra
  114.  
  115. Ignore:
  116. move IgnoreId5 IgnoreId4
  117. move IgnoreId4 IgnoreId3
  118. move IgnoreId3 IgnoreId2
  119. move IgnoreId2 IgnoreId1
  120. move IgnoreId1 Id
  121. s IgnoreSwitch Open 0
  122. j ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement