Okay, I have “Making Things Talk” sitting right here, so I can see what you’re doing. Take a look at the very last paragraph on page 231. It ends with
“in other words, the monkey radio’s PWM0 output will be linked to the sensor radio’s analog input”.
That’s just like what is happening in that Faludi site I sent you: the XBee radios are linked so that the voltage on the transmitting XBee’s pin D0 is mimicked on the receiving XBee’s pin P0. You should be able to put a voltmeter on pin P0 of the receiver (with the other lead on the radio’s ground) and see changes in the voltage that reflect the changes in the D0 analog input from the sensor on the transmitting radio. You ARE using line passing.
On page 234 you’ll see the circuit for that receiving radio: it is set up so that the voltage coming out of pin P0 controls the monkey’s motor. It’s being used really just as an on/off switch, with the sensitivity controlled by that potentiometer, but it’s an analog output that matches the analog input to the pin D0 from the sensor on the transmitting radio.
You asked what the Dn=2 setting is for. That setting tells the transmitting XBee to treat that pin (D0, in this case) as an analog input (as you already knew). That tells the XBee to read the voltage on that pin, and convert it to a digital number, and transmit it by radio. It does NOT send that number out through the transmitting radio’s UART, which is what you’re wishing for, I think. It takes the number and transmits it as a radio signal.
Notice that you didn’t have to set IU to 1 on the transmitting radio, only on the receiving one. The digital representation of the analog voltage WILL be sent out the receiver’s UART, because you set IU=1 on that radio. On the transmitting one, it won’t be sent out the UART no matter what you do.
When you set D0=2 on the transmitting radio, you simply told that radio to do the ADC conversion on inputs to that pin, and send the result out by radio.
Your original question was about attaching another sensor to the base station, and transmitting those data. Where were you expecting to transmit them to? I’m not quite following what your goal here was (unless it’s just to learn how to use these things).
If you wanted it to send those data out to the other XBee (the one currently used as your remote), that might be possible. You’d connect the sensor to pin D1 on the XBee you’re planning to send from, and read the corresponding voltage on pin P1 (PWM1) on the receiving (Remote) XBee. Now, I haven’t carefully looked through the settings to be certain that you can do that. Remember that you also have to set some registers to tie one XBee’s output to the input of the other one, and I’m not sure you can do that bi-directionally at the same time.
As for confusion re. the XPort, if you have PHP scripts running properly, you’re a big step ahead of me. All of that web stuff confuses me, and I’ve put it aside for the time being.