Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SoftwareSerial patch not working
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Leonard Corradine  
View profile  
 More options Oct 20 2012, 6:37 pm
From: Leonard Corradine <lacorrad...@gmail.com>
Date: Sat, 20 Oct 2012 15:37:42 -0700 (PDT)
Local: Sat, Oct 20 2012 6:37 pm
Subject: SoftwareSerial patch not working

Hello,

I downloaded yesterday the patch update in order to communicate through the
SoftwareSerial library, however, though I have configured the radios as
specified, I cannot get them to talk to each other. I would like to know if
there are any additional settings that need to be applied, other then
setting up MY addresses and, enabling API mode.

Here is my code, just in case:

#include <XBee.h>
#include <StopWatch.h>
#include <SoftwareSerial.h>

#define sensPin5 0

int sensVal[6] ;
int count[2] ;
int countTot[2] ;
unsigned long lastTwo = 0;
const char comma = ',';

// allocate two bytes for to hold a 10-bit analog reading
uint8_t payload[] = { 0, 0, 0, 0 };

Tx16Request tx = Tx16Request(0x5000, payload, sizeof(payload));
SoftwareSerial nss(2,3);
XBee xbee = XBee();

StopWatch stopW2 ;

void setup()
{
   Serial.begin(9600);
   nss.begin(9600);
   xbee.begin(nss);
   xbee.setSerial(Serial);
   Serial.print("<<<Program started>>>");
   Serial.println();

}

void loop()
{
    sensVal[5] = pulseIn(sensPin5, HIGH);

   if(sensVal[5] != 0)
   {
    //Serial.println("pin 5");
    stopW2.start();
    count[1] ++ ;
      if(stopW2.elapsed() - lastTwo > 500 )
      {
        //Serial.println(count[1]);
        lastTwo = stopW2.elapsed();
        countTot[1] = count[1];
        payload[2] = countTot[1] ;
        payload[3] = comma ;
        //Serial.println(payload[2], DEC);
        xbee.send(tx);
        count[1] = 0;
      }  
   }

I would kindly appreciate any help.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Rapp  
View profile  
 More options Oct 20 2012, 10:09 pm
From: Andrew Rapp <andrew.r...@gmail.com>
Date: Sat, 20 Oct 2012 20:09:00 -0600
Subject: Re: SoftwareSerial patch not working

The begin and setSerial functions are identical. In this case you are
setting software serial, then setting it to hardware serial, so you never
use software serial. You can use one but not both. So to use software serial

    xbee.setSerial(nss);

If hardware serial then

xbee.setSerial(Serial)

Always call begin on your serial object first, whether software or hardware

On Sat, Oct 20, 2012 at 4:37 PM, Leonard Corradine <lacorrad...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leonard Corradine  
View profile  
 More options Oct 21 2012, 9:11 am
From: Leonard Corradine <lacorrad...@gmail.com>
Date: Sun, 21 Oct 2012 06:11:14 -0700 (PDT)
Local: Sun, Oct 21 2012 9:11 am
Subject: Re: SoftwareSerial patch not working

Hi,

Thank you for the brief reply, I will put your them in practice and post
the results, hopefully they will help other people.

Cheers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leonard Corradine  
View profile  
 More options Oct 25 2012, 4:47 pm
From: Leonard Corradine <lacorrad...@gmail.com>
Date: Thu, 25 Oct 2012 13:47:39 -0700 (PDT)
Local: Thurs, Oct 25 2012 4:47 pm
Subject: Re: SoftwareSerial patch not working

So, I've been using the library for the past days and it seems to be
working without any inconveniences. Thank you for the contribution!  


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Rapp  
View profile  
 More options Oct 26 2012, 1:02 pm
From: Andrew Rapp <andrew.r...@gmail.com>
Date: Fri, 26 Oct 2012 11:02:51 -0600
Local: Fri, Oct 26 2012 1:02 pm
Subject: Re: SoftwareSerial patch not working

Thanks for the feedback!

On Thu, Oct 25, 2012 at 2:47 PM, Leonard Corradine <lacorrad...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »