At the end of this project, you should be able to:
Serial.begin(115200); Serial.setTimeout(100000000); delay(1000);
This C++ notation is new for many of you. Here, there is a software object that is related to a specific piece of hardware (in this case, the serial communications port that is connected to your laptop/desktop). The global variable name for this object (provided by the Arduino environment) is Serial.
begin() is a function (also called a method) that is executed with respect to this object. The 115200 is a parameter that tells the serial port to send/receive data at 115,200 bits per second.
void display_distance(float dist), which changes the state of the LED pairs to reflect the specified distance.
Serial.printf("Hello, World!\n\r");
will print out the indicated string.
int i = Serial.parseInt();
The user will type in a distance in millimeters.
Remember that documentation is about helping you and others looking at your code to understand what it is doing. Therefore, it will generally describe the logic of the code (and not-necessarily the low-level details). For this class:
See an example for the specific format that we are looking for.
Last modified: Tue Feb 23 23:04:00 2021