Specific changes to the code for this version are mostly limited to parts that apply to the broadcasting routines, since with XBee technology we use regular UART serial communication instead of the VirtualWire commands. Browsing the Tx-side sketch, it is worth noting that the sensor's pressure data stream is interrogated in the loop to also determine altitude above ground (in 5 m increments), besides the usual vertical speed calculations.
A consequence of the fact that we now strive to keep track of the actual altitude, is the need for more accurate (i.e. temperature compensated) real-time pressure data. To this end the earlier simplified sampling routine used with version 2 is replaced by the more elaborate and fully temperature compensated routine outlined in the Bosch API.
In the Rx-side sketch a start-up "jingle" indicates the major version number by the number of beeps ("3" in this case). Furthermore, the altitude data is monitored several times a minute for significant changes to the flight level, and if no signal is received for approximately five seconds a short warning beep is sounded. Additional blocks of code have been introduced to support the specific SpeakJet functions which enable the synthetic voice speaker to announce the the model's altitude (presently up to 400 m AGL).
Arduino IDE version 0023 was used when developing these sketches. They may or may not work "as is" with version 1.0 and later, but this has not been tested yet.
Updates 2013-05-29
Code versions Tx_42/Rx_62 has the following added or improved features:
Smarter altimeter function translates barometric values to "true" altitude AGL, as pressure decreases non-linearly with height.
The range of altitude phrases for the SpeakJet voice is increased to 500 meter.
The acoustic variometer signals now reflects climb speed both in pitch and frequency (as variometers usually do). Earlier only the pitch of the tone varied.
The non-blocking Tone library (by Brett Hagman) is now used instead of the blocking standard tone() function.