Pages: [1]   Go Down
Author Topic: Sending a text between two Arduino (wired)  (Read 603 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys.

Can you please help me how to code and wire a project of mine.
It goes like this:
I type on the serial monitor of laptop1 and sends it to arduino1
and the arduino1 sends it to arduino2
and arduino2 sends it to laptop2 serial monitor.

Is there a way to possible do this? if not, then do you know a way how to send a message through arduinos?
Please help me.
Logged

Queens, New York
Online Online
Faraday Member
**
Karma: 101
Posts: 3644
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yea if you had 2 Arduino Megas
Edit, Yea you can use software serial.

I didn't have my coffee yet, so I'm not fully awake yet.
« Last Edit: January 14, 2013, 07:59:23 am by HazardsMind » Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe software serial could be used instead.
Logged

Copenhagen / Denmark
Offline Offline
Edison Member
*
Karma: 6
Posts: 2360
Do it !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Or you could use softserial:

PC1 -> ordinary serial (USB) -> Arduino1 -> soft serial -> Arduino2 -> ordinary serial (USB) -> PC2
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you considered I2C ? EasyTransfer is often cited as a very good library for that.

http://www.billporter.info/2011/05/30/easytransfer-arduino-library/
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the fast reply and the help.. I'm gonna try this.

We just have 2 Arduino Uno R3. We are planning to put it on an LCD Screen on the later part but we are still having problems displaying it on Serial Monitor.

A question, does softwareserial can also send strings or characters?


>Yes we tried the easytransfer but it just blinks the led. can you tell me how to print the message sent from arduino1 to the serial port of laptop2?
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So you've written some code, but it didn't work. My suggestion is then to post it.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We tried using the wire examples: Arduino1 as the master writer and Arduino2 as the slave receiver.
as the exampled worked we got the hello looping on serial monitor of Arduino2 so we try to modify the program like this:

Code:

#include <Wire.h>
char rx_byte;
void setup()
{
  Wire.begin(); // join i2c bus (address optional for master)
 
}


void loop()
{
  Wire.beginTransmission(4); // transmit to device #4
  Wire.write(rx_byte);        // sends five bytes
  Wire.endTransmission();    // stop transmitting

  delay(500);
}


I don't know to much of the libraries function so I just fooled around with it.
Logged

Yorkshire England
Offline Offline
Sr. Member
****
Karma: 2
Posts: 267
Arduino good init
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You haven't assigned anything to rx_byte.
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Fooling around with libraries is not the best way to produce working code.
A better option is to carefully read the library documentation and search for any additional information about the underlying protocol, if needed.
At that point one can come here with precise questions, and find help.

my 2 cents.
Logged

Pages: [1]   Go Up
Jump to: