In the previous recipes, we saw how to communicate something to Arduino. In this recipe, we are going to close the recipes about Arduino with the opposite operation—how to read the data that Arduino controls.
Reading data from Arduino
Getting ready
Communication with Arduino with the serial port provides mainly three functions:
- Serial.read()
- Serial.write()
- Serial.print()
The first one has already been discussed in the previous recipes, as it is used to communicate commands from Delphi to Arduino. Let's move on to the next two:
- Serial.write(): Writes binary data to the serial port. This data is sent as a byte or a series of bytes in order to send the characters representing the digits of a number to use the print...