Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Serial.print /SerialUSB print in Arduino IDE with M0 Trinket
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Serial.print /SerialUSB print in Arduino IDE with M0 Trinket

by OriginP on Sun Jun 07, 2020 4:26 pm

Hello,

I've been trying to use Serial.print and serial.read with the M0 Trinket USB port using the Arduino IDE. I want to use the USB port to send and receive data between the M0 Trinket and a PC. No luck with finding examples or explanations outside of the Adafruit note saying Adafruit uses Serial.x while official Arduino uses SerialUSB.x.

Serial.x is usually so easy to use. I must be missing something significant as to how it has changed with M0 Trinket. Any advice or suggestions would be greatly appreciated.

Thank you,
Eric

OriginP
 
Posts: 3
Joined: Thu Jun 04, 2020 6:50 am

Re: Serial.print /SerialUSB print in Arduino IDE with M0 Tri

by dastels on Mon Jun 08, 2020 10:33 am

Is your code stalling on setting up the serial connection?

Dave

dastels
 
Posts: 3076
Joined: Tue Oct 20, 2015 3:22 pm

Re: Serial.print /SerialUSB print in Arduino IDE with M0 Tri

by gajillion on Tue Jun 23, 2020 10:18 pm

Make sure you have this after your Serial.begin statement
Code: Select all | TOGGLE FULL SIZE
while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

gajillion
 
Posts: 7
Joined: Wed May 20, 2015 6:03 pm

Re: Serial.print /SerialUSB print in Arduino IDE with M0 Tri

by rmoquin on Sun Jul 05, 2020 10:55 am

I too had been struggling getting serial output from my Trinket M0 (which are broken now, which will be a different post), but if this is needed for the M0, it could be helpful to have a note or reminder added to the docs. Maybe it's obvious, but I completely forgot about trying it as I've been struggling to figure it out. I don't work with Arduino consistently enough to remember to try certain things like this unfortunately.

rmoquin
 
Posts: 65
Joined: Wed Jun 04, 2014 10:22 am

Please be positive and constructive with your questions and comments.