User manual
LPCXpresso Experiment Kit - User’s Guide
Page 52
Copyright 2013 © Embedded Artists AB
Run the program and enter five characters and then hit enter. What happens?
_______________________________________________________________________
The reason for this is that there is a queue on the LPCXpresso side. Each time getchar() is called om
the microcontroller side, a character is removed from the queue.
Also note that text written by the user is printed in green color and text from the target system (i.e., the
LPC111x) is printed in black color.
The blocking implementation of the read functions limits the usefulness. A final application would never
use this functionality. It would simply not be practical to always have the LPCXpresso IDE connected
to the system. It can however be a very useful functionality when debugging. The application can for
example ask the user at startup if special settings shall be used. The user can then quickly test several
settings without having to recompile the application.
As an extra experiment, create a program that reads input from the console and converts it to a
number. Check that only digits are entered and that the final number is within the range of a 32-bit
number.