Update transmit.py add read

master-bd
Alan Johnston 3 weeks ago committed by GitHub
parent dcfa155d7c
commit 14762e5089
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -523,29 +523,29 @@ def update_doppler(fm):
global mode
global tx
print("update_doppler")
try:
relative_time = (time.perf_counter() - start_time) % 370
except:
start_time = time.perf_counter()
relative_time = (time.perf_counter() - start_time) % 370
index = int(relative_time/10)
print(f"relative time: {relative_time:.1f} seconds after AOS is index: {index}")
table_row = doppler_table[index]
rx_doppler_shift_hz = table_row["doppler_434_khz"] * 1000
if (mode == 'e'):
tx_doppler_shift_hz = table_row["doppler_144_khz"] * 1000
with open("/home/pi/CubeSatSim/frequency.txt", "r") as file:
frequencies = file.read().split()
new_tx_frequency = int(frequencies[0])
new_rx_frequency = int(frequencies[1])
print(f"New frequencies: {new_tx_frequency}, Second number: {new_tx_frequency}")
if (tx_doppler_freq_hz != new_tx_frequency) or (rx_doppler_freq_hz != new_rx_frequency):
tx_doppler_freq_hz = new_tx_frequency
rx_doppler_freq_hz = new_rx_frequency
print(f"Tx Doppler shift: {tx_doppler_freq_hz:.0f}")
rx_doppler_freq_hz = rx_doppler_start_hz + rx_doppler_shift_hz
print(f"Rx Doppler shift: {rx_doppler_freq_hz:.0f}")
if (fm != "no"):
rx = "{:.4f}".format(rx_doppler_freq_hz/1e6)
if (mode != 'e'):
tx = "{:.4f}".format(tx_doppler_freq_hz/1e6)
print(tx)
program_fm(rx,tx,rxpl_value,sq,txpl_value)
else:
tx_doppler_shift_hz = rx_doppler_shift_hz
tx_doppler_freq_hz = tx_doppler_start_hz + tx_doppler_shift_hz
print(f"Tx Doppler shift: {tx_doppler_freq_hz:.0f}")
rx_doppler_freq_hz = rx_doppler_start_hz + rx_doppler_shift_hz
print(f"Rx Doppler shift: {rx_doppler_freq_hz:.0f}")
if (fm != "no"):
rx = "{:.4f}".format(rx_doppler_freq_hz/1e6)
if (mode != 'e'):
tx = "{:.4f}".format(tx_doppler_freq_hz/1e6)
print(tx)
program_fm(rx,tx,rxpl_value,sq,txpl_value)
print("No frequency changes!")
except:
print("update_doppler failed")

Loading…
Cancel
Save

Powered by TurnKey Linux.