Skip to content

Commit

Permalink
rds text tested
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-fryza committed Feb 26, 2025
1 parent 3ec6e2b commit dd960bc
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions examples/40-fm-tuner-rda5807/_steam_klub_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

# https://github.com/franckinux/python-rd5807m/tree/master




# MicroPython TechNotes: Rotary Encoder
# https://techtotinker.com/2021/04/13/027-micropython-technotes-rotary-encoder/


# Micropython builtin modules
Expand All @@ -24,7 +23,6 @@
# from MPU6050 import MPU6050 # Accelerometer + gyroscope
import rda5807 # FM radio module


# DHT11: Data - 4
# Temperature + Humidity
# d = DHT11(Pin(4, Pin.IN, Pin.PULL_UP)) # The input mode and pull-up need to be set manually!
Expand Down Expand Up @@ -67,7 +65,8 @@
time.sleep_ms(100) # Let the radio initialize!!! Without the sleep the module does not work!
# init with default settings
radio.set_volume(1) # 0-15
radio.set_frequency_MHz(103.0) # Radio Krokodyl (Brno)
radio.set_frequency_MHz(103.0) # 103: Radio Krokodyl (Brno)
# 88.3: Kiss (Brno)
radio.mute(False)

# Piezo buzzer 100ms beep
Expand Down Expand Up @@ -122,15 +121,23 @@ def floatToStr(f: float):
# display.text('DHT11 meas. fail', 0, 0, 1)

# FM Radio
display.text(str(radio.get_frequency_MHz())+' MHz', 0, 0, 1)
rssi = radio.get_signal_strength()
print(rssi, "dBm")
radio.update_rds()
# print(radio.get_rds_block_group()) # How to decode RDS?
print(radio.station_name)
radio_name = "".join(map(str, radio.station_name))
print(f"Stanice: {radio_name}")
display.text(str(radio_name), 0, 0, 1)

radio_text = "".join(map(str, radio.radio_text))
print(f"Text: {radio_text}")

display.text(str(radio.get_frequency_MHz())+' MHz', 0, 8, 1)

rssi = radio.get_signal_strength()
# print(rssi, "dBm")
display.text(str(rssi)+' dBm', 85, 8, 1)

display.show()
time.sleep_ms(100)
time.sleep_ms(10)

except KeyboardInterrupt:
# This part runs when Ctrl+C is pressed
Expand Down

0 comments on commit dd960bc

Please sign in to comment.