I want to read the voltage of the transmitting xbee connected to a pot, that is sent to the receiving xbee connected to a logic level converter to the Arduino. I am using two xbee series 1 modules in transparent mode, and one arduino rev 3. A pot is connected to the transmitting xbee. The arduino is connected to the receiving xbee. I have a logic level converter between the arduino and xbee.
Everything works great if I use an LED connected to the receiving xbee instead of the arduino. Wirelessly The LED dims and brightens as expected. I also can measure the voltage with a volt meter and can read 0 to 5 volts on the receiving xbee pwm output. Everything changes when remove the LED connected directly to the receiving xbee, and attach the PWM signal from the receiving xbee to the ardino analog input. I get inconsistant voltages as I turn the transmitting pot.
My wild guess is that the arduino analog input is sampling the xbee pwm output, and perhaps the PWM frequencies diferences are causing problems? If so How would I correct this. Ultimately I would like to make use of the pololu motor controller VNH 5019 which I bought and build my first robot. This is my beginning. I am learning API and xbee, but it seems the transparent mode is simpler.
float val = 0;
float result = 0;
result = analogRead(val);
Thank you very much!