Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Serial Monitor behaving oddly

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    6

    Serial Monitor behaving oddly

    I'm trying to get the example Teensyduino sketch 'Hello World' working using Ubuntu 1804, Arduino IDE 1.8.6, Teensyduino 1.4.5 and a Teensy LC. I've got the Teensy LC connected to a USB3 port. Here is the snippet I'm running:

    Code:
    /* Simple "Hello World" example.
    
       After uploading this to your board, use Serial Monitor
       to view the message.  When Serial is selected from the
       Tools > USB Type menu, the correct serial port must be
       selected from the Tools > Serial Port AFTER Teensy is
       running this code.  Teensy only becomes a serial device
       while this code is running!  For non-Serial types,
       the Serial port is emulated, so no port needs to be
       selected.
    
       This example code is in the public domain.
    */
    
    void setup()Monitor 
    {
      Serial.begin(9600); // USB is always 12 Mbit/sec
    }
    
    void loop()
    {
      Serial.println("Hello World...");
      delay(1000);  // do not print too fast!
    }
    Technically it does work but I'm getting odd and inconsistent behavior. I upload the sketch, then set the port to /dev/ttyACM0 (Teensy LC) Serial, then open the Serial Monitor - and I immediately get six or seven outputs of 'hello world', all with the same timestamp (which makes sense since the program has been running that long. The serial monitor won't add any more updates in real time, and when I close it, then heading changes to 'serial monitor closed' but the window stays open until I Alt-F4 it a few times.

    Click image for larger version. 

Name:	Screenshot from 2019-03-24 13-39-54.jpg 
Views:	4 
Size:	112.6 KB 
ID:	16245

    Possibly related to this, everything seems to be inconsistent in general. This will happen sometimes, but sometimes I can't get anything at all in the serial monitor. It was giving me live updates every second the first time I ran it, but I wasn't familiar enough with anything yet to know what was different (I'm very new to this in case you didn't already guess that ). I've been adding LED patterns to the programs so that I have a visual indicator that they uploaded correctly (this is somewhat inconsistent too - I sometimes get errors when trying to upload programs and can't find a pattern there either).

    Does this sound familiar to any of you more experienced folks?

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,381
    Bad usb cable?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •