Welcome! Log In Create A New Profile

Advanced

Ramps 1.4, Sparkfun XBee shield, two way communication !

Posted by twimbee 
Ramps 1.4, Sparkfun XBee shield, two way communication !
January 15, 2015 03:34PM
Hi, I am trying to achieve a two way wireless communication between an arduino mega stacked with ramps 1.4 and and my computer. I can currently achieve this by stacking the sparkfun XBee shield directly onto arduino mega, however to achieve the two way communication in this way I had to jumper-connect pins 2 and 3 on XBee shield to RX1, TX1 on arduino mega.

The code below and the hardware configuration above allow me a two way communication between arduino and computer.

void setup() {

  Serial1.begin(9600);
  Serial.begin(9600);
}

void loop() {
  if (Serial.available()) {
    // If data comes in from serial monitor, send it out to Computer-XBee
    Serial1.write(Serial.read());
  }
  if (Serial1.available()){
    // If data comes in from XBee, send it out to serial monitor
    Serial.write(Serial1.read());
  }
}

Now, I would like to use a ramps 1.4 board in my project and be able to still have the two way com as above. Can someone please help me do the correct hardware configuration between the XBee shield and ramps board. Also what code changes would I have to do to the code above if any?

NOTE: I will not use any 3D printing firmware, I will write all the necessary code once I get past the communication issue, I am not trying to do a 3D printer.

Regards.
Re: Ramps 1.4, Sparkfun XBee shield, two way communication !
January 15, 2015 05:31PM
This RAMPS 1.4 pin diagram might help: [reprap.org]


[3DKarma.com] - suppliers of quality, affordable 3D printer kits and filament for the UK market.
Re: Ramps 1.4, Sparkfun XBee shield, two way communication !
January 16, 2015 03:06PM
Thanks, I worked it out using the diagram. If I use the end-stop pins D18 and D19 on ramps board I can get the two way com.
Sorry, only registered users may post in this forum.

Click here to login