Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: (Seemingly) Simple Xbee Communication handling problem on: December 05, 2012, 05:55:51 pm
Ok, went home, changed the baud to 4800 for both modems and code and it works perfectly.

Even without any delays in either system.

Thanks so much for the help.
2  Using Arduino / Networking, Protocols, and Devices / Re: (Seemingly) Simple Xbee Communication handling problem on: December 05, 2012, 07:52:05 am
"Series 1, right out of the box with no changes,"
This is exactly right.  With the antenna no less, not the chip.

I am transmitting 'T' just because my receiving code needs to see a non-numeric in order to know when one number stops and the next starts.
This seems to be a creation of the Arduino in that it doesn't send any message indicating string termination.
I had to add it in order for the code to work when direct connected.

I have had delays change things in interesting ways before, maybe it will work here.
I wish I knew the buffer sizes so that I could plan for this stuff...

I'll give this a try and I'll uncomment the code as well for grumpy PaulS.

Thanks for the help, both of you.
(PS finals are coming up)
3  Using Arduino / Networking, Protocols, and Devices / Re: (Seemingly) Simple Xbee Communication handling problem on: December 03, 2012, 04:32:46 pm
Man this seems to be stumping everyone...
4  Using Arduino / Networking, Protocols, and Devices / (Seemingly) Simple Xbee Communication handling problem on: December 01, 2012, 12:47:37 pm
Ok,

Background:
I have successfully gotten direct communication between 2 Unos using Software Serial working.
My sending station sends the numbers 1 to 100 repeating to the receiving station which outputs it to the serial monitor. 

Here's my next challenge: I want to replace this direct connection with 2 Xbees.

In each case I have the Xbees and Uno's connected with 3 wires.
The sending station has 1 Gnd to Gnd, 1 5V to 5V, and 1 from Pin 3 to Rx on the Xbee.
The green light is flashing.

The receiving station has 1Gnd to Gnd, 1 5v to 5V and 1 from Pin 2 to Tx on the Xbee.
The green light is flashing and the red light is lit constantly.

My code for both stations is this:
SENDING
Code:
#include <SoftwareSerial.h>

SoftwareSerial Xbee(2,3);

int i;

void setup()
{
  Serial.begin(57600);
  Xbee.begin(57600); 
} // Setup

void loop()
{
 
   
  for ( i = 1; i <= 100; i++)
  {
   
   Xbee.print(i);
   Xbee.print('T');
   Serial.println(i);
   
   delay(500);
   
  }
 
} // Loop

RECEIVING
Code:
#include <SoftwareSerial.h>

SoftwareSerial Xbee(2,3);

int RecVar;
int input;

void setup()
{
  Serial.begin(57600);
  Xbee.begin(57600); 
} // Setup

void loop()
{
//  delay(50);
   
  if(Xbee.available())
  {
   
    RecVar = Xbee.read();
    //Serial.println(RecVar); //Troubleshooting step
    if(isDigit(RecVar))
     {
       input = (input * 10) + (RecVar - 48);
     }
    else
    {
      Serial.println(input);
      input = 0;
    }
   
  }
 
} // Loop

So when Directly Connected (1wire pin 3 to pin 2, 1 wire GND to GND) I get this:
Quote
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...

But when put through the Xbees I get:
Quote
2
3
4
5
6
8
9
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
2
0
2
0
2
0

What's the Xbee Doing?

Thanks for any help
5  Using Arduino / Programming Questions / Re: Arduino to Arduino Serial Communication on: November 15, 2012, 05:51:08 pm
Ok, no luck really.

First my full setup.
I have a Sending Station:
Uno R3
Powered by wall plug adapter
1 wire connecting the 3 pin to the 2 pin on the Receiving Station
1 Wire connecting the GND to the GND on the Receiving Station

I have a Receiving Station:
Uno R3
Powered via USB to computer
Connections as described above

No other connections on either Station.

The new Serial Monitor output looks like this:
Quote
56
57
57
57
57
57
57
57
57
57
57
49
49
50
51
52
53
54
55
56
57
55
55
56
56
56
56
56
56
56
56
56
56
57
57
57
57
57
57
57
57
57
57
49
49
50
51
52
53
54
55
56
57
54
55
56
57
49
48
49
49
49
50
49
51
49
52
49
53
49
54
49
55
49
56
49
57
50
48
50
49
50
50
50
51
50
52
50
53
50
54
50
55
50

Different, but still doesn't look like 1-100 repeating. 
Even if it's giving the ascii equivalent of the char they don't repeat properly, I don't think. 
I would expect every 3rd value to be the 'end' value.
6  Using Arduino / Programming Questions / Re: Arduino to Arduino Serial Communication on: November 15, 2012, 01:42:11 pm
Here's what my Serial Monitor returns.
Though I don't have a ground wire between them.
How do connect that?  Just Ground to Ground? or is there a different pin + command I should use?

Code:
54
183
134
133
54
145
134
133
54
183
134
133
54
145
134
133
54
151
134
133
54
177
134
133
54
183
134
133
54
7  Using Arduino / Programming Questions / Arduino to Arduino Serial Communication on: November 14, 2012, 03:02:32 pm
Ok,

This seems so simple but I just can't get it to work.
I've tried buffers and subtracting '0' and looking for '/n' and about 100 other ways to get serial communication to work.
I've tried to use .print, .println, and .write.  Nothing seems to work.
I simply am stuck.
So Please, any help.

Ok, I have 2 Uno R3s connected from pin2 to pin3.
All I want to do is send a number from one to the other.
here's my code on the sending station:
Code:
#include <SoftwareSerial.h>

SoftwareSerial DirectConnect(2,3);

int i;

void setup()
{
  Serial.begin(57600);
  DirectConnect.begin(57600); 
} // Setup

void loop()
{
 
   
  for ( i = 1; i <= 100; i++)
  {
   
   DirectConnect.print(i);
   Serial.println(i);
   delay(50);
   
  }
 
} // Loop

and here's my code for the receiving station:
Code:
#include <SoftwareSerial.h>

SoftwareSerial DirectConnect(2,3);

int RecVar;
void setup()
{
  Serial.begin(57600);
  DirectConnect.begin(57600); 
} // Setup

void loop()
{
  delay(50);
   
  if(DirectConnect.available())
  {
   
    RecVar = DirectConnect.read();
   Serial.println(RecVar);
   
  }
 
} // Loop

This is vastly simplified from the functions I really want to do, but I just can't get this to go.
8  Using Arduino / Displays / LCD Display Connection on: April 28, 2011, 10:10:10 pm
I'm curious if I can find a way to connect and control this thing:
http://www.amazon.com/Display-Screen-Video-Generation-Replacement/dp/B000MD2UWG/ref=dp_return_2?ie=UTF8&n=172282&s=electronics

This may be a repost, but I don't know the name of the connection to search for it.
Is it some kind of tape connector? 

9  Using Arduino / Installation & Troubleshooting / Re: 5v out of the 3.3v Pin on: April 27, 2011, 06:02:06 am
"Short on or off the board?  The FTDI chip is damaged?"

Not sure how I would know this...
10  Using Arduino / Installation & Troubleshooting / 5v out of the 3.3v Pin on: April 26, 2011, 07:24:58 pm
I keep getting 5v out of my 3.3v Pin.
Just discovered it when I tried to run my temp sensor off 3.3v because its supposed to be less noisy.
Code and scaling didn't make any sense.

I tried powering my UNO with both the USB and a AC to DC converter and got the same result.

Any Ideas?
11  Using Arduino / Sensors / Re: TMP36 Reading Very Low on: April 24, 2011, 08:06:02 am
Ok,

So I took out my multimeter, crossed it over the direct + to - terminals on the bread board and got 5V.
This is despite having the supply coming out of the 3.3V socket.

Which means the sensors work, but the 3.3v Socket is actually 5v.  Any idea why?

I've got the SMD Uno if that's any help.

12  Using Arduino / Sensors / TMP36 Reading Very Low on: April 24, 2011, 07:55:24 am
My Uno keeps returning the following:

Temp reading = 147 - 0.47 volts
-2.63 degress C
27.27 degress F

This is in my house at about 70F.

Here is my code:
//TMP36 Pin Variables
int tempPin = A0;        //the analog pin the TMP36's Vout (sense) pin is connected to
                        //the resolution is 10 mV / degree centigrade with a
                        //500 mV offset to allow for negative temperatures
int tempReading;        // the analog reading from the sensor
   
void setup(void) {
  // We'll send debugging information via the Serial monitor
  Serial.begin(9600);   

  // If you want to set the aref to something other than 5v
  analogReference(EXTERNAL);
}


void loop(void) {
 
  tempReading = analogRead(tempPin); 
 
  Serial.print("Temp reading = ");
  Serial.print(tempReading);     // the raw analog reading
 
  // converting that reading to voltage, which is based off the reference voltage
  float voltage = tempReading * aref_voltage / 1024;
 
  // print out the voltage
  Serial.print(" - ");
  Serial.print(voltage); Serial.println(" volts");
 
  // now print out the temperature
  float temperatureC = (voltage - .5 ) * 100 ;  //converting from 10 mv per degree wit 500 mV offset
                                               //to degrees ((volatge - 500mV) times 100)
  Serial.print(temperatureC); Serial.println(" degress C");
 
  // now convert to Fahrenheight
  float temperatureF = (temperatureC * 9 / 5) + 32;
  Serial.print(temperatureF); Serial.println(" degress F");
 
  delay(1000);
}

My setup is identical to this:
http://www.ladyada.net/wiki/lib/exe/fetch.php?hash=8d4837&w=514&h=592&media=http%3A%2F%2Fwww.ladyada.net%2Fimages%2Flogshield%2Fsensorwiring.gif

minus the photo resistor.

I've tried everything, no idea why the voltage returned isn't what it should be.
I purchased 12 of these sensors and have tried 3.  All with the same results.


Pages: [1]