Go Down

Topic: How to pass Multi_byte values between two Arduinos (Read 728 times) previous topic - next topic

Monster

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!

AWOL

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?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Monster

how to pick apart an "int" and re-assemble it at the receiver

br3ttb

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

Go Up