Advertisement
Guest User

coderdojovr

a guest
Jan 18th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. from picamera import PiCamera
  2. import time
  3. import random
  4.  
  5. name = "ISS (ZARYA)"
  6. line1 = "1 25544U 98067A 19352.98291280 -.00000451 00000-0 16927-6 0 9991"
  7. line2 = "2 25544 51.6430 165.1707 0007614 51.0107 86.0364 15.50119867203926"
  8. #update line1 and line2 before sending this to the ISS
  9.  
  10. iss = ephem.readtle(name, line1, line2)
  11.  
  12. measure = 0
  13. photo_counter = 0
  14. #non modificare le variabili
  15.  
  16.  
  17. def get_latlon(time = None):
  18. if(time is None):
  19. iss.compute()
  20. else:
  21. iss.compute(time)
  22.  
  23.  
  24. def FileNameWithDate():
  25. return time.strftime("/home/pi/image_%y-%m-%d_%H-%M-%S",time.localtime())
  26.  
  27. timer=10800
  28.  
  29.  
  30. while timer>0:
  31. cam = PiCamera()
  32. ora=time.clock
  33. cam.resulution = (1296,972)
  34. cam.start_preview()
  35. time.sleep(10)
  36. cam.capture(FileNameWithDate())
  37. cam.stop_preview()
  38. timer -= 10
  39. #main program to capture images
  40.  
  41.  
  42. from random import randint
  43.  
  44. s = SenseHat()
  45. s.low_light = True
  46.  
  47. s.clear()
  48.  
  49. import math
  50.  
  51. yellow = (255, 255, 0)
  52. green = (0, 255, 0)
  53. blue = (0, 0, 255)
  54. fucsia = (255, 0, 255)
  55. cyan = (0, 255, 255)
  56. red = (255, 0, 0)
  57. orange = (255, 160, 0)
  58.  
  59.  
  60.  
  61. colors=[yellow,green,blue,fucsia,cyan,red,orange]
  62.  
  63.  
  64. sensehat = SenseHat()
  65.  
  66. sensehat.low_light = True
  67.  
  68.  
  69.  
  70.  
  71.  
  72. class Spinner():
  73.  
  74. def __init__(self,sensehat):
  75. self.s=sensehat
  76. self.points=[]
  77.  
  78.  
  79. self.points=[(3,0),(4,0),(5,0),(6,1),(7,2),(7,3),(7,4),(7,5),(6,6),(5,7),(4,7),(3,7),(2,7),(1,6),(0,5),(0,4),(0,3),(0,2),(1,1),(2,0)]
  80.  
  81.  
  82. self.curpos=0
  83.  
  84. self.s.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement