diff --git a/examples/40-fm-tuner-rda5807/_steam_klub_test.py b/examples/40-fm-tuner-rda5807/_steam_klub_test.py index 6009059..6bed803 100644 --- a/examples/40-fm-tuner-rda5807/_steam_klub_test.py +++ b/examples/40-fm-tuner-rda5807/_steam_klub_test.py @@ -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 @@ -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! @@ -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 @@ -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