Serial

The Arduino Serial functionality can be used for both debugging and sending data to and from the device via other communication channels such as BlueTooth.

Debugging

Start the serial channel in the Setup method with:

Serial.begin(9600);

In the loop you can use the following to print out a single value.

Serial.println( _ _ _ _ );

Multiple variables are a bit more complicated but it can be achieved with:

char report[80];
snprintf(report, sizeof(report), "Distance: %+6d",averageDistance); 
Serial.println(report);

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.