Show Posts
Pages: [1]
1  Using Arduino / Installation & Troubleshooting / SerialException with Arduino v1.0.2 and Leonardo on: November 07, 2012, 04:09:43 am
When I tried uploading this sketch I get SerialException after it's done uploading.

Code:
#define LED 13
#define DELAY 500

unsigned long nextTime;
int ledState = HIGH;

void setup() {
  pinMode(LED, OUTPUT);
  digitalWrite(LED, ledState);
  ledState = (ledState == HIGH) ? LOW : HIGH;
  nextTime = millis() + DELAY;
}

void loop() {
  if (millis() > nextTime) {
    nextTime += DELAY;
    digitalWrite(LED, ledState);
    ledState = (ledState == HIGH) ? LOW : HIGH;
  }
}

The sketch seems to run OK though.

This doesn't happen with a Uno target or with IDE v1.0.1 or v1.5.x

I'm on a Mac OS X Lion (10.7.5).

v1.0.1 has a hanging bug with tone() on Leonardo so I need to use either 1.0.2 or 1.5.x, but 1.5.x is still in beta.

Can someone else confirm this bug?

The full message from the IDE is as follows:

Code:
Binary sketch size: 4,952 bytes (of a 28,672 byte maximum)


processing.app.SerialException: Serial port '/dev/tty.usbmodemfd1211' already in use. Try quitting any programs that may be using it.
at processing.app.Serial.touchPort(Serial.java:119)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:201)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1671)
at processing.app.Sketch.exportApplet(Sketch.java:1627)
at processing.app.Sketch.exportApplet(Sketch.java:1599)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380)
at java.lang.Thread.run(Thread.java:680)

Thanks.
Pages: [1]