Help with NewSoftSerial.

I have a couple XBEEs and my Arduino Duemilanove with nkc’s xbee shield V3.

As my first mini-project/learning experience I want to have my Duemilanove w/ xbee recieve data from a remote xbee with a temperature sensor (with or without an arduino, not sure yet. I don’t know how to program the xbee yet, so I might start off with one of my breadboard arduino’s doing the work) and display it on a serial LCD.

As a start, mostly because I don’t have any sort of interface for my second xbee to connect it to another arduino (yet), i want to display text sent from an xbee connected to my desktop (via xbee explorer USB). This requires two software serial “ports” on the Duemilanove. One for the LCD and one for the XBEE.

To restate, I want text (or anything really) sent from the xbee connected to the computer to appear on the LCD on the arduino (which recieves the data from it’s own arduino).

Using ladyada’s xbee tutorials as a guide, I have not been able to figure it out, so I thought I’d ask for help rather than waste time.

#include <NewSoftSerial.h>

int LCDrx = 15;
int XBEErx = 2;
int XBEEtx = 3;
NewSoftSerial LCDSerial = NewSoftSerial(LCDrx, 255);
NewSoftSerial XBEESerial =  NewSoftSerial(XBEErx, XBEEtx);
char buffer = 0;

void setup()
{
  pinMode(13, OUTPUT);
  LCDSerial.begin(9600);
  XBEESerial.begin(9600);
  LCDSerial.print("?G216");   // set display geometry,  2 x 16 characters in this case
  delay(100);                // pause to allow LCD EEPROM to program
  LCDSerial.print("?B80");    // set backlight to ff hex, maximum brightness
  delay(100);                // pause to allow LCD EEPROM to program
  LCDSerial.print("?s6");     // set tabs to six spaces
  delay(1000);               // pause to allow LCD EEPROM to program
  LCDSerial.print("?f");      // makes sure the LCD is cleared.
}

void loop()
{

...?

}

Thanks!

I would presume something like:

if (XBEESerial.available()){
  LCDSerial.print(XBEESerial.read());
}

thats pretty much what i tried, and it doesnt work.

btw I'm using one of these serial LCD boards: http://moderndevice.com/LCD.shtml

anyone else have any insight?

Scott,

The line

NewSoftSerial LCDSerial = NewSoftSerial(LCDrx, 255);

defines a NewSoftSerial object that can receive but can't transmit.

This is probably not what you want connected to an LCD display.

Mikal

ahh crap i had it backwards…idiot

i was backwards on the xbee too ( you wouldnt know because you cant see my wiring )

thanks alot

sure is a lot of orca dick around here.

ChristopherPfaff should immediately be removed from this forum.

ChristopherPfaff should immediately be removed from this forum.

He's been terminated.. thanks