Page 125 - ARM Based Microcontroller Projects Using MBED
P. 125
7.13 PROJECT 10—USING AN EXTERNAL BUTTON 111
FIG. 7.51 Project built on a breadboard.
BEGIN
Configure Button as input
Configure LED as output
DO FOREVER
IF button is pressed THEN
Turn ON LED
ELSE
Turn OFF LED
ENDIF
ENDDO
END
FIG. 7.52 PDL of the program.
7.13.8 DigitalIn Modes
The DigitalIn statement supports the following modes:
PullUp: Pull-up the GPIO pin internally (no need for external resistor)
PullDown: Pull-down the GPIO pin