Advertisement
aarons6

Solar IC

Apr 8th, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. # Dual Axis Solar Tracking
  2. # Power Port on Solar Panel faces East(Sunrise)
  3. # Solar Sensor faces East with port down.
  4. # Will park sensors at dusk.
  5. # Set Batch Writers input to the IC, and output
  6. # to SolarPanel, one writer to Vertical, and
  7. # the other writer to Horizontal.
  8.  
  9. alias solarsensor d0
  10. alias batchvertical d1
  11. alias batchhorizontal d2
  12. loop:
  13. l r3 d0 Activate
  14. beq r3 1 start
  15. s db Setting 0
  16. s d1 On 1
  17. yield
  18. s d1 On 0
  19. s db Setting 90
  20. s d2 On 1
  21. yield
  22. s d2 On 0
  23. yield
  24. l r3 d0 Activate
  25. breqz r3 -2
  26. j loop
  27.  
  28. start:
  29. jal vertical
  30. jal horizontal
  31. j loop
  32.  
  33. horizontal:
  34. s d0 Mode 2
  35. l r0 d0 SolarAngle
  36. add r0 r0 86
  37. s db Setting r0
  38. s d2 On 1
  39. yield
  40. s d2 On 0
  41. j ra
  42.  
  43. vertical:
  44. s d0 Mode 1
  45. l r1 d0 SolarAngle
  46. #sub r1 r1 75
  47. div r1 r1 1.8
  48. s db Setting r1
  49. s d1 On 1
  50. yield
  51. s d1 On 0
  52. j ra
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement