Si4703 simple single channel sketch

Hi,

I've been working with the Si4703 FM Tuner breakout board from Sparkfun and the Radio library from Matthias Hertel, mathertel.de. I have the radio working with the example sketches but would like to create something from scratch and I'm failing on the basics.

What I would like to start with is a simple sketch which creates an instance for the radio and tunes it to a single frequency. I'm obviously missing something basic but I can't find an example this simple to help me get started:

#include <Wire.h>
#include <SI4703.h>

const int resetPin = 2;
const int SDIO = A4;
const int SCLK = A5;

SI4703 radio; ///< Create an instance of a SI4703 chip radio.

void setup() {
  // Initialize the Radio
  radio.init();
  radio.setMono(true);
  radio.setVolume(5);
  // Set radio frequency
  radio.setBandFrequency(RADIO_BAND_FM, 9500);
}

void loop() {

}

Any pointers would be appreciated on how to use the radio commands directly without using the Serial input.

void loop() {
  // Set radio frequency
  radio.setBandFrequency(RADIO_BAND_FM, 9500);
}

How many times do you need to do that?

Things that need to happen once should happen in setup(). Things that need to happen over and over happen in loop().

The code does something. You forgot to tell us what is actually does.

You expect it to do something. If what it does is what you want, it seems unlikely that you would have posted a complaint. So, I think it is safe to assume that what it does is not what you want.

But what it does, and how that differs from what you want, and how your "doesn't do what I want" code differs from the "works, but I wanted to do it myself code" are all mysteries that you need to clear up.

How many times do you need to do that?

Yes, apologies, in this example the line should be in the setup (the original post has been updated):

radio.setBandFrequency(RADIO_BAND_FM, 9500);

When I have it working it will be switching between frequencies in the loop.

Found my problem, it was a corrupt library! All working now :slight_smile: