Using Serial Communication
Serial communication is used to transfer data between two devices.
Data passes between the computer and Arduino through the USB cable. Data is transmitted as zeros (‘0’) and ones (‘1’) sequentially.
Arduino dedicates Digital I/O pin # 0 to receiving and Digital I/O pin #1 to transmit.
For this reason, we typically do not use Digital I/O 0 or 1 for anything in our designs.
Serial Monitor & analogRead()
Sending a Message
void setup() { // initialize serial to a baud rate of 9600. Ensure that the same baud rate is set in the serial monitor. Serial.begin(9600); } void loop ( ) { Serial.print("Hands on") ; //does not insert a newline at the end; next message continues on the same line Serial.print("Learning ") ; //does not insert a newline at the end; next message continues on the same line Serial.println("is Fun!!!") ; //inserts a newline at the end; next message is printed on a new line }]] ></ac:plain-text-body></ac:structured-macro><p><br /></p><p>If you see strange-looking characters in the serial monitor, your bit / baud rate set in the Serial Monitor most likely does not match the one used in your Arduino sketch.</p>