
WIRELESS COMMUNICATION 189
When you’ve got the microcontroller pro-
grammed, open the serial port that the receiver
is connected to using your serial terminal program,
at 2400 bits per second (thus far you’ve operated at
9600 or 19200 bps. For this example, just set your serial
terminal program to communicate at 2400 bps instead
of 9600). You might see a string of garbage characters.
That’s because the transmitter started sending before the
receiver was activated. Reset the microcontroller while
the serial port is open. After a few seconds, it should start
sending again, and you should see a string of numbers
representing the potentiometer’s value, like this:
127
128
128
129
130
129
You may also get garbage characters on the screen, even
when the transmitter is turned off. This is because the
receiver’s picking up random noise in its frequency range.
This can be generated by a wide range of sources. All elec-
trical devices emit some RF waves, so if your receiver is
sitting beside an LCD or CRT display, for example, it could
be picking up noise from that. In the absence of a signal
from the transmitter, the receiver will display anything it
gets. This is one of the downsides of working with simple
transmitter-receiver pairs like this: you need to filter out
the garbage in your program. More advanced transceivers
like the ones in the next example will do some or all of that
filtering for ...