ScratchRadio Programming
Program Structure
All Scratch Radio programs will have the same underlying structure consisting of two distinct phases. The radio setup phase is used to configure the way the radio will operate by connecting various radio blocks together. The radio operation phase then activates the radio and allows the radio to transmit and receive radio signals as required.
There are three Scratch Radio blocks which are used to control these phases of operation – the reset, start and stop blocks. The reset block is used to discard any previous radio configuration and prepare the radio at the start of the setup phase. Once the radio has been configured, the start block is used to activate the radio at the start of the operation phase. Finally, the stop block is used to halt the radio at the end of the operation phase. This means that all Scratch Radio programs will have a structure similar to the one shown below:
Flow Graph Setup
The setup phase of a Scratch Radio program is used to connect various radio blocks together into a data flow graph to create a complete radio system. Scratch Radio blocks which may be used during the setup phase are indicated by the use of a flow graph icon at the left hand side of the Scratch block. These icons have the following meanings:
A valid flow graph is created by connecting data flow blocks in a particular manner. Every data flow should start with a source block. Source blocks must not be immediately preceded by another source, process or tap block and must be immediately followed by a process or sink block. Multiple process blocks may then be chained together, ending with a sink block. The net effect is that the data flow icons ‘connect’ to give a visual indication of the data flow. A simple example which shows a radio source being filtered and output to a display sink block is shown below:
|