Serial Port problem with teensy 4.0

stellartom

New member
I have a data usb cable and plug in my Teensy 4.0 but can get a serial port. Meanwhile the slow blink program is running. I use the Teensy loader to load the blink fast hex file and it works. Anyone have any ideas?
 
Seems the cable is working to allow upload.

The standard BLINK programs do not issue, or respond to, any USB Serial activity either send or receive?

Not clear what ideas need to be addressed?

Here is a quick edit of SerialPassthrough {with added BLINK in setup() until Serial is online} example made to ECHO back anything sent over USB:
Code:
const int ledPin = LED_BUILTIN;    // the number of the LED pin
int ledState = LOW;                // ledState used to set the LED
unsigned long previousMillis = 0;  // will store last time LED was updated
const long interval = 100;        // interval at which to blink (milliseconds)
void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  unsigned long currentMillis;
  while (1) {
    currentMillis = millis();
    if (Serial)
      break;
    if (currentMillis - previousMillis >= interval) {
      // save the last time you blinked the LED
      previousMillis = currentMillis;
      // if the LED is off turn it on and vice-versa:
      if (ledState == LOW) {
        ledState = HIGH;
      } else {
        ledState = LOW;
      }
      // set the LED with the ledState of the variable:
      digitalWrite(ledPin, ledState);
    }
  }
}
void loop() {
  if (Serial.available()) {       // If anything comes in Serial (USB),
    Serial.write(Serial.read());  // read it and send it out Serial (USB)
  }
}
 
Thanks for the reply. The point I was trying to make is that I don't see the usual port on my macbook pro that I've seen in the past.
 
Thanks for the reply.
The sketch p#2 was edited and tested here ... was it used and tested there? With what results?
With USB type Serial is should upload and shows a fast 100ms Blink until Serial connects.
When/If there is no blinking then something has connected the USB.
When not blinking any USB text sent in will echo back to the 'SerMon' that is connected.
 
Solved my problem. Reinstalled IDE after a clean uninstall and put the Teensy in boot-loader mode. Waited for the serial port to show and was able to down load program.
 
Back
Top