Pages: [1]   Go Down
Author Topic: Serial Port Stops Working  (Read 538 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I've tried searching google and the archives of this forum and haven't found any solutions posted for the problem I'm having. I apologize in advance if this has been posted elsewhere, but I really did spend at least 35 minutes searching.

Board: Arduino Esplora
OS: Windows 7
Other Peripheral Devices: USB mouse receiver and bluetooth mouse


I've got a new Arduino Esplora and after using it for about 15 minutes on any given COM port, it stops working. I just got this new model today and it is my first Arduino board. Essentially, somewhere in executing simple sketches, the Arduino environment keeps losing sight of my serial ports. Even if I restart the Esplora or unplug/replug it in. My Esplora is connected via USB and when I go to Device Manager, even after it loses sight, it's still there. My PC still sees the board and is communicating with it, but for some reason the environment can't communicate with it over the COM port. There simply isn't anything listed under Tools --> Serial Port. When I right click on "Arduino Esplora (COM#)" on my Device Manager, if I go to Port Settings --> Advanced.. --> and change the Port number, that will work once I restart my Esplora, but even after I reboot the PC I still can't use the ports (for me, 5 and 7) that have been, in a sense, "banned" by the Arduino software!

I'd appreciate any help you guys can offer as I'm fairly new to using COM ports in this manner and fairly new to this device and software!

Brad
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 499
Posts: 19065
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What sketch (code) do you have on the board? If it emulates a mouse, for example, you will lose your COM port as it "becomes" a mouse.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply. The sketch I've been using is this:

Code:
#include <Esplora.h>

void setup(){
  Serial.begin(9600);
}

void loop(){
 
  String initializer = "";
  String dataStream = stringOne + " " + Esplora.readSlider() + ", " + Esplora.readLightSensor() + ", " + Esplora.readTemperature(DEGREES_F) + ", " + Esplora.readMicrophone()
  + ", " + Esplora.readJoystickSwitch() + ", " + Esplora.readAccelerometer(X_AXIS) + ", " + Esplora.readAccelerometer(Y_AXIS) + ", " + Esplora.readAccelerometer(Z_AXIS) +
  ", " + Esplora.readButton(SWITCH_DOWN) + ", "  + Esplora.readButton(SWITCH_UP) + ", " + Esplora.readButton(SWITCH_LEFT) + ", " + Esplora.readButton(SWITCH_RIGHT) + ", " +
  Esplora.readJoystickX() + ", " + Esplora.readJoystickY();

  Serial.println(dataStream);

  delay(1000);
}

It seems to be working great minus it's COM port flaw. The sketch is just supposed to compile the data from a few of the sensors into the serial output so I can grab it and play with it in Ecplise using Java.
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

String is broken.  String concatenation is very broken.

Instead of needlessly creating a big String like that, what happens if you just Serial.print each of those elements individually?

When you see that work fine, then start using a pre-defined length character array instead of the String object.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Pages: [1]   Go Up
Jump to: