User Manual

That's all there is to the basic Si4713 usage with CircuitPython!
Below is a complete demo that will configure the board for FM transmission at a specified frequency (see the
FREQUENCY_KHZ variable at the top). It will broadcast RDS data and periodically print audio input level and signal
quality status. In addition it also shows basic usage of the GPIO outputs of the Si4713 with the gpio_control and
gpio_set functions--these aren't commonly used but are available if you need a couple small outputs from the board.
Save this as code.py on your board.
Full Example Code
# Simple demo of using the SI4743 RDS FM transmitter.
# Author: Tony DiCola
import time
import board
import busio
import digitalio
import adafruit_si4713
# Specify the FM frequency to transmit on in kilohertz. As the datasheet
# mentions you can only specify 50khz steps!
FREQUENCY_KHZ = 102300 # 102.300mhz
# Initialize I2C bus.
i2c = busio.I2C(board.SCL, board.SDA)
# Initialize SI4713.
# si4713 = adafruit_si4713.SI4713(i2c)
# Alternatively you can specify the I2C address of the device if it changed:
# si4713 = adafruit_si4713.SI4713(i2c, address=0x11)
# If you hooked up the reset line you should specify that too. Make sure
# to pass in a DigitalInOut instance. You will need the reset pin with the
# Raspberry Pi, and probably other devices:
si_reset = digitalio.DigitalInOut(board.D5)
print('initializing si4713 instance')
si4713 = adafruit_si4713.SI4713(i2c, reset=si_reset, timeout_s=0.5)
print('done')
# Measure the noise level for the transmit frequency (this assumes automatic
# antenna capacitance setting, but see below to adjust to a specific value).
noise = si4713.received_noise_level(FREQUENCY_KHZ)
# Alternatively measure with a specific frequency and antenna capacitance.
# This is not common but you can specify antenna capacitance as a value in pF
# from 0.25 to 47.75 (will use 0.25 steps internally). If you aren't sure
# about this value, stick with the default automatic capacitance above!
#noise = si4713.received_noise_level(FREQUENCY_KHZ, 0.25)
print('Noise at {0:0.3f} mhz: {1} dBuV'.format(FREQUENCY_KHZ/1000.0, noise))
# Tune to transmit with 115 dBuV power (max) and automatic antenna tuning
# capacitance (default, what you probably want).
si4713.tx_frequency_khz = FREQUENCY_KHZ
si4713.tx_power = 115
© Adafruit Industries https://learn.adafruit.com/adafruit-si4713-fm-radio-transmitter-with-rds-rdbs-support Page 24 of 27