Serial Monitor behaving oddly

Status
Not open for further replies.

DougSauve

Member
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.

Screenshot from 2019-03-24 13-39-54.jpg

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?
 
Status
Not open for further replies.
Back
Top