Advertisement
aalh

ploop

Dec 28th, 2023
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. t_stamp = time.mktime(gps.timestamp_utc)
  2. PLOG_FILE = f"{t_stamp}pressure.txt"
  3. start = time.monotonic_ns()
  4. deadline = start / 1e9 + 60
  5. with open((plog_path+PLOG_FILE), LOG_MODE) as pressfile:
  6. print(t_stamp, gps.latitude, gps.longitude, gps.altitude_m, file=pressfile)
  7. curr_time = start
  8. while curr_time < deadline:
  9. curr_time = (time.monotonic_ns() - start) / 1e9
  10. print(curr_time, lps.pressure, file=pressfile, flush=True)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement