User Manual

# Configure RDS broadcast with program ID 0xADAF (a 16-bit value you specify).
# You can also set the broadcast station name (up to 96 bytes long) and
# broadcast buffer/song information (up to 106 bytes long). Setting these is
# optional and you can later update them by setting the rds_station and
# rds_buffer property respectively. Be sure to explicitly specify station
# and buffer as byte strings so the character encoding is clear.
si4713.configure_rds(0xADAF, station=b"AdaRadio", rds_buffer=b"Adafruit g0th Radio!")
# Print out some transmitter state:
print('Transmitting at {0:0.3f} mhz'.format(si4713.tx_frequency_khz/1000.0))
print('Transmitter power: {0} dBuV'.format(si4713.tx_power))
print('Transmitter antenna capacitance: {0:0.2} pF'.format(si4713.tx_antenna_capacitance))
# Set GPIO1 and GPIO2 to actively driven outputs.
si4713.gpio_control(gpio1=True, gpio2=True)
# Main loop will print input audio level and state and blink the GPIOs.
print('Broadcasting...')
while True:
# Print input audio level and state.
print('Input level: {0} dBfs'.format(si4713.input_level))
print('ASQ status: 0x{0:02x}'.format(si4713.audio_signal_status))
# 'Blink' GPIO1 and GPIO2 alternatively on and off.
si4713.gpio_set(gpio1=True, gpio2=False) # GPIO1 high, GPIO2 low
time.sleep(0.5)
si4713.gpio_set(gpio1=False, gpio2=True) # GPIO1 low, GPIO2 high
time.sleep(0.5)
© Adafruit Industries https://learn.adafruit.com/adafruit-si4713-fm-radio-transmitter-with-rds-rdbs-support Page 25 of 27