drabont

Stationeers - TrueClock

Sep 15th, 2020
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #= TrueClock = v0.1 ================== by swagman =#
  2. #   _____                  ___  _           _      #
  3. #  |_   _|_ _  _  _  ___  / __|| | ___  __ | |__   #
  4. #    | | | '_|| || |/ -_)| (__ | |/ _ \/ _|| / /   #
  5. #    |_| |_|   \_,_|\___| \___||_|\___/\__||_\_\   #
  6. #==================================================#
  7. # Precision clock with automatic synchronization   #
  8. #= 2020.09.16 05:22  https://youtu.be/l1p3qit11XA =#
  9. alias SolSens d0 #face to east
  10. alias LedDisp d1
  11. alias time r15
  12. alias olda r14
  13. alias oldd r13
  14. loop:
  15. l r0 SolSens SolarAngle
  16. sub r1 r0 olda
  17. mul r2 r1 oldd
  18. brgez r2 2
  19. move time 0
  20. move oldd r1
  21. move olda r0
  22. trunc r0 time
  23. s LedDisp Setting r0
  24. add time time 0.5
  25. sgtz r1 r1
  26. select r0 r1 5 0 #5-day, 0-night
  27. s LedDisp Color r0
  28. yield
  29. j loop
Add Comment
Please, Sign In to add comment