Notifications
Clear all

Coding Nano 33 IoT

3 Posts
2 Users
1 Likes
1,320 Views
(@kevin333)
Member
Joined: 3 years ago
Posts: 13
Topic starter  

I notice that in some of the coding you have a ! in front of Serial

ie-   While (!serial);

my question is what is the exclamation mark there for.

thanks 

Kevin


   
Quote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2037
 

@kevin333

The explanation mark is the NOT operator.  It inverts true to false and false to true.

while (! Serial); "ensures that there is something at the other end of the USB connection for the Arduino to talk to before it starts sending messages. Otherwise, the message might be sent, but not displayed. This line is actually only necessary if you are using an Arduino Leonardo, (and apparently the Nano 33 IoT?) because the Arduino Uno automatically resets the Arduino board when you open the Serial Monitor, whereas this does not happen with the Leonardo."

 


   
Sean451 reacted
ReplyQuote
(@kevin333)
Member
Joined: 3 years ago
Posts: 13
Topic starter  

@robotbuilder

Hi thank you for your reply 

It does make sense and I now understand why it is so.

This side of Arduino is new to me.

Regards

Kevin


   
ReplyQuote