Beginning Robotics with Raspberry Pi and Arduino by Jeff Cicolani

Beginning Robotics with Raspberry Pi and Arduino by Jeff Cicolani

Author:Jeff Cicolani
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


This uses the “not” operator, or exclamation mark (!). In order for the condition to evaluate to true it must not meet the criteria. In this case, as long as a connection is not available, execute the code in the block. But, since there is no code, it simply halts the program until one is available.

Sending Serial Data

Much of what we’ll do is simply printing to the serial port. In fact, that’s what we’ve been doing in earlier examples. The method Serial.println() sends the data within the parenthesis to the serial port. The serial monitor in the Arduino IDE allows you to see this output.

To write data to the serial stream, you generally use one of the serial print methods. Serial.print() prints the contents of the parentheses to the serial stream without a new line terminator. This means that everything you print using this method appears on the same line in the serial monitor.

The Serial.println() method includes the new line terminator. So everything printed with this method is followed by a new line.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.