Pages: [1]   Go Down
Author Topic: Serial causing problems  (Read 364 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this is my program:

/*
 * Blink
 *
 * The basic Arduino example.  Turns on an LED on for one second,
 * then off for one second, and so on...  We use pin 13 because,
 * depending on your Arduino board, it has either a built-in LED
 * or a built-in resistor so that you need only an LED.
 *
 *
 */

int ledPin = 13;                // LED connected to digital pin 13

void setup()                    // run once, when the sketch starts
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output

  Serial.begin(9600);


}

void loop()                     // run over and over again
{
  digitalWrite(ledPin, HIGH);   // sets the LED on
  Serial.println("Hello there");
  delay(3000);                  // waits for a second
  digitalWrite(ledPin, LOW);    // sets the LED off
  delay(1000);                  // waits for a second
}
-----------------------------
When i load this program, my Arduino Mega grinds to a halt. when i remove the references to Serial it will happily flash the led. it is bound to be something really simple, but is there something someone can see which is causing my program to fail.

I just want to be able to send and receive characters from the Arduino Serial monitor to the board and back again.

all help appreciated.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26332
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What happens if you just remove the "Serial.prinltn", and leave in the "Serial.begin (...);"  ?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Even if i leave just  Serial.begin(9600)  ,the arduino halts as well.

I do notice when i upload the program i get this output as well:

Couldn't determine program size:   text   data   bss   dec   hex   filename

Is that indicative of the problem?
« Last Edit: June 03, 2009, 05:36:47 pm by stevenkatona » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I happened to be doing some ratting around and also found the following warnings during the compilation process:

/usr/share/arduino-0015/hardware/cores/arduino/wiring_serial.c: In function 'USART_RX_vect':
/usr/share/arduino-0015/hardware/cores/arduino/wiring_serial.c:110: warning: 'USART_RX_vect' appears to be a misspelled signal handler

I googled this and found a post where someone (much more knowlegeable than me) indicated that if an interupt handler is not defined, then the arduino will constantly reset when the handler is called.

has anyone come across this in arduino-0015 and a mega board?
Logged

Pages: [1]   Go Up
Jump to: