Using one Arduino connected with a potentiometer, and the other one connected with an LED, read pin(A0) to get the analog result and pass the Multi-byte values to Arduino_B to control the brightness, how to do this?
Thanks!
Using one Arduino connected with a potentiometer, and the other one connected with an LED, read pin(A0) to get the analog result and pass the Multi-byte values to Arduino_B to control the brightness, how to do this?
Thanks!
Assuming that the LED is on a PWM pin, then there's no need to pass multibyte values - the PWM value will be a single byte.
Are you asking how you would physically connect the two boards, or how to pick apart an "int" and re-assemble it at the receiver?
how to pick apart an "int" and re-assemble it at the receiver
You could use a union on each side. Convert the int to a byte array on the send side, then convert that array back on the receive side.
This post (and the replies that follow) should get you there. They're converting floats, but it will work with ints as well. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207242838
-Brett