In this system configuration (
GPIO_TEST3
), the GPIO "loopback" connection of the previous example is replaced with connections to real devices, which replace the Graphical User Interface (GUI) elements:- Pin 3 is configured as an output connected to an LED (the yellow button) in series with a 100 Ohm resistor to ground.
- Pin 5 is configured as an input with an internal pull-up resistor, connected to a normally open pushbutton (the green button) to ground.
- The value of the pushbutton input (
BUTTON.X
) is passed to the LED output (LED.X
) via the graphical connection, and theLED
block is notified of the current pushbutton status by theBUTTON.CNF => LED.REQ
event connection.
- When the button is up (open), the state of pin 5 is HIGH due to the internal pullup resistor on the input pin, and this is passed to the LED on pin 3 as an ON condition, as shown in the picture on the left below.
- When the button is down (closed), it pulls pin 5 LOW and this is passed to the LED on pin 3 as an OFF condition, as shown in the picture on the right below (the green button is held down with transparent tape in order to take the picture).
No comments:
Post a Comment