Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / Re: [UNO] - Basic serial commands not working. on: October 04, 2012, 11:17:48 am
Quote
I attached the Xbees and powered them back on, but could not get the LEDs to flash in sync.
I'm not surprised. Serial data transmission takes time, especially at 9600 baud. Sending data over the air takes time. Combining them and expecting 0 delay is unreasonable.

I waited over a minute with no result. I had them talking previously, and they would start up and talk within a few seconds.

UPDATE: I tested both of my Xbees in the X-CTU app. One reads, the other does not. So I think I have a faulty Xbee module. Off to Sparkfun! Thanks everyone!
2  Using Arduino / Networking, Protocols, and Devices / Re: [UNO] - Basic serial commands not working. on: October 04, 2012, 10:37:22 am
Quote
I saw that in another thread, and did connect the grounds together, with no luck. Same result.

Should I try SoftwareSerial?
If you can't send data via the hardware serial port, what makes you think you will be successful using two other pins?

Quote
is there a way to make SoftwareSerial work with the Xbees?
Yes, but what does that have to do with your problem of not being able to send data without the XBees?

I feel like i'm missing something fundamental, and my trying SoftwareSerial, i'm starting from scratch in a different direction.

So I started from scratch, with this on one Arduino:


int LED = 13;
int incomingByte;   

void setup() {
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  digitalWrite(LED, LOW);
}

void loop() {
  if (Serial.available() > 0) {
    incomingByte = Serial.read();
    if (incomingByte == 'H') {
      digitalWrite(LED, HIGH);
    }
    if (incomingByte == 'L') {
      digitalWrite(LED, LOW);
    }
  }
}


And this on another:


int LED = 13;

void setup()
{
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  digitalWrite(LED, LOW);
}

void loop()
{
  Serial.print('H');
  digitalWrite(LED, HIGH);
  delay(1000);
  Serial.print('L');
  digitalWrite(LED, LOW);
  delay(1000);
}


And I can now get them to flash their LEDs! So I have progress. I attached the Xbees and powered them back on, but could not get the LEDs to flash in sync. I tried connecting grounds together with the Xbee shields attached and that didn't work. I removed the Xbees, re-attached the serial wires, and it started working again.

I'm going to re-program the Xbee modules again and see what happens.
3  Using Arduino / Networking, Protocols, and Devices / Re: [UNO] - Basic serial commands not working. on: October 04, 2012, 08:05:40 am
Do you have the grounds connected?

I saw that in another thread, and did connect the grounds together, with no luck. Same result.

Should I try SoftwareSerial? is there a way to make SoftwareSerial work with the Xbees?
4  Using Arduino / Networking, Protocols, and Devices / [UNO] - Basic serial commands not working. on: October 03, 2012, 04:42:59 pm
Hi everyone,

I have two Arduino Unos that I can't seem to get talking to one another via serial. I uploaded the PhysicalPixel sketch to one, and another sketch which alternates the 'H' and 'L' characters (as documented in http://arduino.cc/en/Guide/ArduinoXbeeShield).

I've connected Pin 0 of one board to Pin 1 of the other, and vice-versa, and I cannot get the LED to cycle like the sketch says. One significant behavior i've noticed is that the TX LED on the sending Uno flashes every second when I have it powered via USB, but not when I have it powered externally (via a 9V battery or 12V wall wart). Additionally, if I have the Uno plugged in to external power and upload the sketch via USB, the Uno will flash the TX light every second (as the sketch says) until I plug the USB cable, then the TX light stops flashing.

What gives? Lasst week I had them talking to one another via XBee PROs, and now I can't seem to get them to talk simple serial.

Help!

Thanks!
-Matt
Pages: [1]