Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Software/LokoGround Firmware/main_1.1.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def battery_level():

def lora_set(freq_hz):
# Convert Hz to MHz for LoRa module
freq_mhz = freq_hz // 1000000
freq_mhz = freq_hz / 1000000

LORA_UART.write("AT+MODE=TEST")
sleep_ms(1000)
Expand Down Expand Up @@ -486,8 +486,8 @@ def bin_unpack_lat_lon_24(packed_data):
if lat_lon_scaled & 0x800000: # Check if the sign bit is set for a negative value
lat_lon_scaled -= 0x1000000 # Convert to signed 24-bit integer

scaling_factor = 10000.0
lat_lon = lat_lon_scaled / scaling_factor
lat_lon = f'{lat_lon_scaled}'
lat_lon = lat_lon[:-4] + '.' + lat_lon[-4:]

return lat_lon

Expand All @@ -497,8 +497,8 @@ def bin_unpack_lat_lon_32(packed_data):
if lat_lon_scaled & 0x80000000: # Check if the sign bit is set for a negative value
lat_lon_scaled -= 0x100000000 # Convert to signed 32-bit integer

scaling_factor = 1000000.0
lat_lon = lat_lon_scaled / scaling_factor
lat_lon = f'{lat_lon_scaled}'
lat_lon = lat_lon[:-6] + '.' + lat_lon[-6:]

return lat_lon

Expand Down