Hey, I am a newcomer for Arduino and I've just purchased 1x Arduino uno and 1x Arduiono duemilanove.
While I am waiting for sensor components, I tried to implement one of the Arduino as a Analog Input and another one as Analog Output and directly connect their A0 to each.
Here is my partial code:
Code on Arduino uno ~
<omited...>
for(int i=0 ; i<=255 ; i++)
analog.Write(A0,i) ;
Code on Arduino duemilanove ~
analog.Read(A0);
Nevertheless, the results on the Arduino duemilanove showed me only 0 when analog.Write between 1~127 and 1023 when analog.Write between 128 ~255.
May I know why I couldn't get the actual result which was sent by analogOutput?
Why not just send the digital value over instead? Then you don't lose anything in the process. You get the full range of the 0-1023 you captured originally, vs the 'analog-mapping' down to a 0-255 type range that PWM puts out and is filtered before being ADC'd again. Can send it a longer distance too.
Let me put this straight, please ignore the message above.
I have a Nunchuck, 2 XbeeS2s and 2 Arduinos. I have to use the Nunchuck (which connected to one of the arduino) remotely control LEDs which connected to another. The physical connection will be Nunchunk --> Arduino(1) --> Xbee(1) ))))))) Xbee(2) --> Arduino(2) --> LEDs.
The concept in my mind was I send the joystickX and joystickY values (after processing by wiiChuck library) through Pin 9 and Pin 10 which repesent the X and Y values using analogWrite(9,wiichuck.readJoyX()) and then connect them directly to Xbee analog Inputs.
Then the problem I have met was the value that received by Xbee(2) was not same with the value that Xbee(1) sent and the values were unpredictable.
Next I was told that I have to put resistor and capacitor between Arduino(1) and Xbee(1) due to their analog voltage are not sychronise.
I then tried implementing the PWM RC filter acoording to this website. http://www.makingthings.com/wiki/analog-output
But the result was unpredictable too. May I know the resistor or capacitor i used whether is right or not ?
OR, please let me know whether my concept for the implementation is right ?
Then the problem I have met was the value that received by Xbee(2) was not same with the value that Xbee(1) sent and the values were unpredictable.
How are the XBees connected to the Arduinos? How have the XBees been configured? What code is running on the Arduinos? If what was received was not what was sent, there is a problem with your configuration of the XBees, your hardware (how the XBees are connected), or your software.