Page 176 - ARM Based Microcontroller Projects Using MBED
P. 176
162 8. INTERMEDIATE LEVEL PROJECTS
• Start your Mbed and enter the following short code to test the serial interface. You should
see the message Testing the serial interface displayed on your PC screen:
#include “mbed.h”
Serial MyPC(USBTX, USBRX);
int main()
{
MyPC.printf(“Testing the serial interface”)
}
In the above example, the Serial statement creates a virtual serial COM port called MyPC.
USBTX and USBRX are the Mbed names of the serial port on the Nucleo-F411RE
development board.
Configuring the Putty Screen
By default, the Putty screen has black background with white foreground letters as shown in
Fig. 8.23. We can easily change the screen formatting to make it easier to read. For example, we
can make the background white and the foreground black and the font size to 12 as follows:
• Click Window ->Colors at the left-hand side of the Putty start-up screen.
• Set Default Foreground and Default Bold Foreground to black (Red:0, Green:0, Blue:0)
• Set Default Background and Default Bold Foreground to white (Red:255, Green:255,
Blue:255)
• Set Cursor Text and Cursor Color to black (Red:0, Green:0, Blue:0)
• Click Window ->Appearance and change the Font size to 12-point
• Click Session and give a name to the session (e.g., STM32) and click Save to save the new
screen configuration
• Click Open to open the new screen and reload the above program. The screen should now
display as shown in Fig. 8.24
FIG. 8.23 Default Putty screen.
FIG. 8.24 Modified Putty screen.