Working with 2 arduinos

Hey guys, i'm new here, and ive tried to figure out how to use my two ardunios together, but i need some help =(

My project is to use one arduino to register switches and dials, then send said information to the second one wich would execute certain commands. Im using Arduino Uno.

To make it simpler, lets say :
Arduino (A) will register a switch.
Arduino (B) will light pin 13 when said switch is activated.

I know there are alot of smart people in here, and i'd appreciate any help or guidance =)

Funkafett.

how do u want the 2 arduinos to communicate..

So far i've only tested 2wire TX/RX serial, wich seems to work, but i had a hard time getting any code across.

Ive got a cat5 going from A to B.

communication is most likely 90 percent of the work u need to do..
decide on what comm protocol u want,
then include those header files,
and build ur code..
look at examples..

Have a look at serial input basics.

A note on connectivity (just in case). Which Arduino do you use? On e.g. an Uno you can not use TX/RX (TX is actually still fine) as those pins are connected to the 'communication' chip; in which case you need to use the SoftwareSerial library.

sterretje:
Have a look at serial input basics.

A note on connectivity (just in case). Which Arduino do you use? On e.g. an Uno you can not use TX/RX (TX is actually still fine) as those pins are connected to the 'communication' chip; in which case you need to use the SoftwareSerial library.

Thanks! Been trying with TX/RX on Uno, explains why its not working =)

You wouldnt by any chance be able to help me with an example? :smiley:

dude. you should watch this video. it's about the i2c between uno and leonardo. shows uno being master, leonardo being slave and vice versa. Arduino Tutorial #10: Arduino to Arduino I2C - YouTube
it will help

rafiuddin:
dude. you should watch this video. it's about the i2c between uno and leonardo. shows uno being master, leonardo being slave and vice versa. Arduino Tutorial #10: Arduino to Arduino I2C - YouTube
it will help

Wow, great thanks!
This is exactly what im looking for, apart from that i want a input on my master to trigger the led instead of me having to type "H" or "L". Can't be a big deal to change this

Note that there are limits to the lengths of the wire in these communication methods. I'd give i2c 2 feet before the signal degrades.

Funkafett:
Wow, great thanks!
This is exactly what im looking for, apart from that i want a input on my master to trigger the led instead of me having to type "H" or "L". Can't be a big deal to change this

glad to hear. the problem solved i guessed? you may add [SOLVED] in the topic

mistergreen:
Note that there are limits to the lengths of the wire in these communication methods. I'd give i2c 2 feet before the signal degrades.

noticed, well i was hoping for a bit more range.. Is there any way i can send a analog signal from A to B, and have B read it somewhat accurate ? hoping for 50-100meters

RS422 will give you long distance serial. Nobody mentioned SoftSerial, you can make a serial connection on almost any pins with it.

Another solution to the serial problem on the Uno is to stop using the USB port to program it. I have used a USBASP programmer on the ICSP connector to program it when I need to use the hardware serial port for something.

aarg:
Nobody mentioned SoftSerial, you can make a serial connection on almost any pins with it.

I did :wink: Reply #4

You can go wireless with wifi using udp or over the web.

Hi,
Have you got the gnd or both arduino connected together through the comms cable?

Tom.... :slight_smile:

sterretje:
Have a look at serial input basics.

A note on connectivity (just in case). Which Arduino do you use? On e.g. an Uno you can not use TX/RX (TX is actually still fine) as those pins are connected to the 'communication' chip; in which case you need to use the SoftwareSerial library.

Not sure what you are saying, but using isolation diodes can allow a number of external tx lines to be connected to the arduino rx pin.