Page 343 - ARM Based Microcontroller Projects Using MBED
P. 343
13.3 PROJECT 1—TWO NUCLEO BOARDS COMMUNICATING THROUGH UART 329
FIG. 13.5 Program PDL.
13.3.5 The PDL
Fig. 13.5 shows the program PDL.
13.3.6 Program Listing
Fig. 13.6 shows the Sender Node program listing (program: Sender). This program uses
2
the I C compatible TMP102 temperature sensor module as was discussed in Chapter 11.At
the beginning of the program variable Sender is assigned to UART6 pins PC_6 (TX pin) and
PC_7 (RX pin). The program reads the ambient temperature every second and sends it to the
Receiver Node over the UART interface using function Sender.printf. In this project, UART6
of the Nucleo board is used to send the temperature data. The baud rate of the communication
is set to 9600.
The Receiver Node program listing (program: Receiver) is shown in Fig. 13.7. At the
beginning of the program variable Receiver is assigned to UART6 pins PC_6 and PC_7.