User manual

Ausgabe 07.12.2016 Copyright by Joy-IT 18
3
RPi - Explorer700
11. UART sample programs - Transming the serial data received
Noces: The serial port of RPi is set to terminal debugging mode by default. However, in order to run
this sample program, you should disable the terminal debugging funcon, which means you cannot
debug the RPi via the serial port communicaon any more. In this case, you should employ other
methods to debug the RPi before running this program. For example, you can connect an external
HDMI displayer to the RPi or use SSH.
wiringPi program:
Enter the Linux terminal, and run the following commands:
The command for compiling the program:
The command for execung the program:
Expected result: Connect the expansion board to the PC via the USB TO UART interface, and congure
the serial communicaon soware on the PC (Here, you can use the soware PuTTY to monitor the
serial port), selecng the right serial port number and seng the Baud rate to 115200. Then, you can
use your PC to send data to the RPi via the serial communicaon. Aer the data is received by the RPi,
it will be echoed to the serial monitor on the PC.
python program:
Enter the Linux terminal, and run the following commands to execute the program:
Expected result: It is the same as in the above case.
pi@raspberrypi ~/Explorer700/UART/wiringPi $ sudo ./
pi@raspberrypi ~/Explorer700/UART/wiringPi $ make
pi@raspberrypi ~/Explorer700/UART/python $ sudo python uart.py