Struggling with SerialUSB

Post Reply
rickyelqasem
Posts: 10
Joined: Fri May 18, 2018 1:20 pm

Struggling with SerialUSB

Post by rickyelqasem » Sun Jun 02, 2019 2:41 pm

I had one of these about a year ago and SerialUSB worked fine. The USB connector fell off and I only recently purchased 2 more. I can upload blink no problem so I know upload works. But when I upload the code below I get nothing on the Serial monitor. I'm guessing I have forgot something that is quirky about these boards:

SerialUSB.begin(9600);
SerialUSB.print("hey");

any advice?

rickyelqasem
Posts: 10
Joined: Fri May 18, 2018 1:20 pm

Re: Struggling with SerialUSB

Post by rickyelqasem » Sun Jun 02, 2019 3:18 pm

I might have fixed my own issue...

while(!SerialUSB);

Bertus Kruger
Site Admin
Posts: 1447
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Struggling with SerialUSB

Post by Bertus Kruger » Tue Jun 04, 2019 7:46 pm

rickyelqasem wrote:
Sun Jun 02, 2019 3:18 pm
I might have fixed my own issue...

while(!SerialUSB);
The ARM verison of Arduino does not reset the board when a serial connection is made. So the "Hey" would have been sent just after the code completed upload.

Using a while statement ensures that the code only start when a serial connection has been made.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests