Go Down

Topic: serial.begin preventing digitalWrite (Read 845 times) previous topic - next topic

NeX

hi there,

i have a very strange problem

i was working back my program and couldn't find the cause of the problem, so i loaded up the Blink example, and that worked fine, then i added Serial.begin(9600); in the setup loop and upload it, and the LED doesn't blink.

if i comment out the serial line it works again.

i have tried this on two different arduinos (arduino nano, 328 chip)

why would Serial.Begin prevent digital write?

AWOL

Are you going to post code, or do we have to dust off the Ouija board?
"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.

NeX

its not exactly complex code, its as i said, the blink example but with the added line of Serial.begin

but here is the code:

Code: [Select]
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  Serial.begin(9600);
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

WizenedEE

Operating system, IDE version, and compiler version (if different from what comes with the IDE) would be nice.

NeX

OS is Windows XP service pack 3

IDE version is 1.0.0

haven't tried, 1.0.1 though i do have it installed, i am still in the process of migrating the libraries.

i have tried a reboot before anyone asks, and plugging it in and unplugging it again.

arduino is powered from the USB

Go Up