Notifications
Clear all

Coding Nano 33 IoT


Kevin333
(@kevin333)
Active Member
Joined: 11 months ago
Posts: 17
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)
Prominent Member
Joined: 2 years ago
Posts: 883
 

@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."

 

This post was modified 4 months ago 2 times by robotBuilder

Sean451 liked
ReplyQuote
Kevin333
(@kevin333)
Active Member
Joined: 11 months ago
Posts: 17
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