www.mathertel.deArduino ProjectsArduino Radio Library - The Examples

Arduino Radio Library - The Examples

This project is about controlling an FM radio chips by using an Arduino and some optional components like an LCD display, rotary encoder, a LCD+Keyboard shield and Ethernet Shield to build a standalone radio. It comes with several examples for different configurations.

Content of this article:

The radio library comes with a bunch of example applications that all show how to use different hardware setups to control the features of the radio chips.

Common to all of these is that the current set of chips have to be controlled using the I2C bus, also known as the "Wire" library.

The basic examples

This example can be found in the Test___ examples delivered with the library.

For starting with your setup I suggest that you start with one of the simple sketches. There is one for each supported chip.

They all initialize the chip, set a constant FM radio station and control the audio settings so that some output should be heated. They all disable the soft mute function so you should be able to hear the white noise if no station is found on that frequency. Modify the code to your favorite or local radio station and upload it again.

A Radio controlled using the Serial interface

This example can be found in the LCDRadio example delivered with the library.

This sketch works with all of the implemented chips by using the common functions. You might have to modify the source code line where the radio variable is defined to the chip you use. There are out-commented lines for every chip in the sketch. Be sure to activate only one line to avoid compiling errors.

The only IO this sketch does is through the Serial interface and when you open the Serial Monitor window of the Arduino programming environment you can see some output from the library and can control the settings by entering commands in the input text line.

The command ? (and enter) will display a short summary of the available commands.

You can see a lot of information using the Serial monitor window including some debugging output for example the new values send into the registers of the chip.

If you like to explore the chip specific settings you may use the "x" command that outputs the chip registers or other chip specific information. Have a look into the chip specific implementation for more details.

The LCD example

This example can be found in the LCDRadio example delivered with the library.

As with the serialRadio example you have to adjust the code for your chip.

This example implements a full functional radio using an LCD display, a rotary encoder input that aslo has a pushbutton.

Documentation will come soon...

The LCDKeypad example

This example can be found in the LCDKeypadRadio example delivered with the library.

This sketch uses a LCD display shield for IO. It displays the current FM frequency and possible RDS radio information. You can tune the frequency and the volume by using the same commands as with the SerialRadio example.

Documentation will come soon...

WebRadio

This example can be found in the WebRadio example delivered with the library.

The idea of this very advanced sketch is to build a radio that is connected to the local network and can be controlled by using a web interface:

Because of the huge code size of this sketch it only works fine with an Arduino Mega 2560 board.

Documentation will come soon...



      

Continue reading in: Part 3: The Wiring