Block diagram for the receiver. It consists of a Atmel board controlling
an LCD, speaker and the RF receiver.
| Method Summary
scanning every 30 ms, and handles updates.
of button scanning state machine
- Loads initial state. Sets receiver to 9 bit mode, 1200 baud
Setup ports, LCD
Set timer0 to overflow every ms for button polling
Set timer1 to overflow and clear every ms for sound
- Polls PortD for pushbuttons. PD.8 is set calibrations dist
PD.7 is clear calibration dist
PD.5 is toggle sound on/off (default is off)
- Runs receive state machine. Must receive high byte first with 1 in
9th bit, followed by low byte with 0 in 9th bit
Sets flag for processing in main
- Controls timing of button scanning state machine
- Controls sound timing. Toggles PortA to create 500 Hz square wave,
and creates pulse of length PULSE_DURATION (50 ms) only is sound
is enabled. Implements pulse repetition rate set in main
- Calls button scanning every 30 ms, and handles updates.
On update flag, combines high and low bytes to int, then
displays then to LCD, after subtracting calibration distance.
Reloads pulse repetition rate with currDist multiplied by 8