el_supremo
Well-known member
I've been having problems getting serial data printed on the serial port with a Teensy 3 - I'm now using beta7 but it also occurred in the previous version. Perhaps I just misunderstand the way Teensy works.
I have checked device manager to ensure that the correct port (COM9) is being used and it is also selected in the Tools menu. The sketch I'm working with works fine on an Arduino Nano and it prints the initial state of the sketch on the serial monitor.
But with Teensy nothing shows up. I have reduced the problem to a sketch which just prints a counter starting at zero.
This code:
starts at 6 in the Serial monitor!
If I kill the Serial monitor and start it up again, the program is still running so it starts at, say, 11. This is a big difference between the way Teensy works compared to Arduino. On Arduino, restarting the Serial monitor also restarts the Arduino so that the sketch starts by printing 0. But with Teensy, it can take several seconds (*) before you get the Serial Monitor loaded so you miss whatever serial output occurred up to the point that the monitor started.
(*) Another thing I've noticed is that when I start a Teensy sketch and then click on the Tools menu to try to start the monitor, it can take several seconds for the menu to drop down with the options - this occurs in beta7 and previous.
Am I just not doing things properly or is this a problem with the Teensy environment? How do I run a sketch so that I see everything that it prints right from the start?
Pete
I have checked device manager to ensure that the correct port (COM9) is being used and it is also selected in the Tools menu. The sketch I'm working with works fine on an Arduino Nano and it prints the initial state of the sketch on the serial monitor.
But with Teensy nothing shows up. I have reduced the problem to a sketch which just prints a counter starting at zero.
This code:
Code:
void setup() {
Serial.begin(9600);
}
int counter = 0;
void loop()
{
Serial.println(counter++);
delay(1000);
}
starts at 6 in the Serial monitor!
If I kill the Serial monitor and start it up again, the program is still running so it starts at, say, 11. This is a big difference between the way Teensy works compared to Arduino. On Arduino, restarting the Serial monitor also restarts the Arduino so that the sketch starts by printing 0. But with Teensy, it can take several seconds (*) before you get the Serial Monitor loaded so you miss whatever serial output occurred up to the point that the monitor started.
(*) Another thing I've noticed is that when I start a Teensy sketch and then click on the Tools menu to try to start the monitor, it can take several seconds for the menu to drop down with the options - this occurs in beta7 and previous.
Am I just not doing things properly or is this a problem with the Teensy environment? How do I run a sketch so that I see everything that it prints right from the start?
Pete