There's no output to port monitor window

Hola!
I've been faced one problem on the start of learning Leonardo! There's no output to port monitor window! Please tell me why the script doesn't work?

void setup() { Serial.begin(9600); while(!Serial);}
void loop ()
{
for ( int i=0; i<10;i++)
{
Serial.write ("any text...");
delay (10000);
}
}

All USB ports (2.0) where tested all kind of USB-cables I've got where tested (various length)...
But the problem still exists!
I've searched about two days whole Internet including the forum, but there's no solution to solve it...

Windows 8 32-bit. Installed propperly on COM3. LED blinking on the board gives me hope the board is alive...

Why you use Serial.write()? Why not Serial.println()?

BTW, in my system your sketch is working.

I've been faced one problem on the start of learning Leonardo! There's no output to port monitor window!

The Leonardo has a special serial start setup not needed with the arduinos.

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

What baud rate have you got the Serial monitor window set to ?

Incidentally, code laid out like that is difficult to read. It is much better to write

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

I usually put Serial.println("Arduino is Ready"); into setup() as an indicator that proper communication has been established.

...R

Thank You all for answers.
I will answer all questions to me first.

  1. "Why you use Serial.write()? Why not Serial.println()?"
    There's no difference (I know functions have different actions) to my state 'cause there are no output with "write" nor "println"...
  2. "The Leonardo has a special serial start setup not needed with the arduinos." Ok. I know it. And in the code above I place "special piece of code".
  3. "What baud rate have you got the Serial monitor window set to?" I think that there's no difference 'cause output is not present on any baudrate I had setted. By default COM4, Port Monitor have 9600 and in code I use Serial.begin(9600). When I change baudrate synchronously the blank window stays not changed every time after reset or uploading code...
  4. "Incidentally, code laid out like that is difficult to read. It is much better to write" Thank You. You are right. I just type briefly to show whole code only in less strings... To be not banned for overquoting and not using spoilers :slight_smile:

Let me ask you now...

  1. luisilva: "in my system your sketch is working." -I know that the code should be workin' cause I new to Arduino but experienced to C++... There's no reason to not working :slight_smile:
    Let me asking - Have you tested on Leonardo board?

I would like to ask You to show a whole code (to copy/paste) to test with internal LEDs... Is it possible? Or maybe a link to test not in IDE but on board itself. To check the board

I would like to ask You to show a whole code (to copy/paste) to test with internal LEDs... Is it possible? Or maybe a link to test not in IDE but on board itself.

// zoomkat 8-6-10 serial I/O string test
// type a string like on or off in serial monitor. then send or enter
// for IDE 0019 and later

int ledPin = 13;
String readString;

void setup() {
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT); 
  Serial.println("serial on/off test 0021"); // so I can keep track
}

void loop() {

  while (Serial.available()) {
    delay(3);  
    char c = Serial.read();
    readString += c; 
  }

  if (readString.length() >0) {
    Serial.println(readString);

    if (readString == "on")     
    {
      digitalWrite(ledPin, HIGH);
      Serial.println("LED on");
    }
    if (readString == "off")
    {
      digitalWrite(ledPin, LOW);
      Serial.println("LED off");
    }

    readString="";
  } 
}

Dear zoomkat.
Please look at this video.

https://yadi.sk/i/mphGTwehdiZk7

this is on pin13 measurement voltage about 5 V drops to 0 V then jumps to about 5 V and so on

I know that's not a program related but... Seems to me my board doesn't accept any code...
Why my board switched off and then on during uploading code? Is this correct behavior?

video-2014-12-30-23-32-27.mpg (649 KB)

Your original code works on my Leonardo. Using Arduino 1.0.6 and Xubuntu 14.04. (Incidentally 1.5.6 did not want to program the Leonardo).

Are you aware that you have a 10 second delay between the words - I assumed it was 1 second and thought it was not working.

The Leonardo can be a bit troublesome because it restarts the serial connection when it resets so you need to check that the serial monitor is using the correct one.

...R

Robin2. Thanks for reply. Perhaps I will install xubuntu in virtualbox and will keep trying.

How about reinstalling the IDE on your current system first ?

PTRVOID:
Robin2. Thanks for reply. Perhaps I will install xubuntu in virtualbox and will keep trying.

I doubt if that is necessary. It should work with any OS because the IDE is using Java.

...R

UKHeliBob. Thanks for advice, but the answer - not. And you know why? Because I've been installed 3 OS (Windows XP 64 bit, Windows 8.1 32 bit and xubuntu 14.04 64 bit) in VirtualBox. In main OS (Windows 7 64 bit) and virtual OSs I installed Arduino IDE with drivers and jre if needed.
In all OSs the same problem - I can not upload scetch. I will be more accurately when say that I can not understand what happens to IDE and the board because a process of uploading finished RX had been blinking and after all - there's no response and any output in port monitor...

Robin2. I've been surprised when first time install linux and find it more reliable in case of hardware like Leonardo cause there's no f***ing spell-casting over unsigned drivers and stupid OS restrictions.
Not one of 3 Windows (7, 8, XP) lets me install IDE and start working... I may write how I tried to install driver under Windows 7 and XP or finding missin usbser for a long time but the fact lunux gave me way to focus on writing scetch... :slight_smile:

Please, don't suspect me in holy war (linux vs windows) :slight_smile:

Ok, may I ask You to watch short film on Youtube (less than 5 minutes only) with my attempt to upload scetch into the Leonardo board...

I can not understand what I'm doing wrong? Maybe sequence of my actions is wrong?

Hope, You will help me find answers.

Loosing USB port connection...

Try another USB port on the PC.
Try connecting through a USB hub with its DC power supply connected to ensure 500mA supply.
Try on another PC with a simpler OS setup.
Try installing the latest version of the IDE.

Try a manual erase, then manual reset procedure.

Is this a genuine Arduino or a clone?

PTRVOID:
Ok, may I ask You to watch short film on Youtube

I lost patience ...

What version of the Arduino IDE are you using. As I mentioned in Reply #8 1.0.6 worked with the Leonardo for me but 1.5.6 did not. I did not explore why.

You might also check what version of Java is on your PC (java -version)

Glad you like Ubuntu - drivers? what are they?

...R

Robin2
"Glad you like Ubuntu - drivers? what are they?"

Forget! Maybe I use messy phrase - all I want to say there's no annoying unsigned driver problem like in Windows. But I admit that MAYBE the unsigned-driver-problem is only on my machine :slight_smile: I won't dispute on it...

I will try other versions of IDE...

"I lost patience ..."

I beg you pardon. That's not a goal. I just wanted to show whole process to be pointed on my mistakes if any... And cause I'm not a native english speaker I have needed additional time to add subtitles...

Did I understood you right, you cannot upload sketches to the Leonardo?
I have Micro, same processor, and I need to keep it resetted while the upload starts, then stop resetting when the upload has started. I dont know if Micro and Leonardo behaves the same way there
.

PTRVOID:
Forget! Maybe I use messy phrase

Sorry - it was me who was confusing. I just meant that there is usually no need to bother with drivers on linux - which is nice.

"I lost patience ..."

I beg you pardon.

Again - that was intended as a joke, and sympathy with you in your problem.

Let us know if a different version of the IDE sorts the problem. I usually use 1.5.6 but I also have 1.0.6 on my PC.

...R