By the end of this section, you will gain experience in the following topics:
- Using GPIO via Gemstone
- Preliminary preparation for the t3gemstone/examples/gpio project.

Todo: GPIO pins of the board
LED
LED

Button
Button
Resistor
Resistor

1
GPIO Connections
Make the GPIO connections to the Gemstone board.
3
Shell
Create Bash Shell scripts.
1. Turning on an LED
1.1. GPIO Connections
Connect the LED to GPIOX on the Gemstone, which is available for Input/Output, as shown below.
LED connection
1.2. Creating a Shell Script
After connecting to the Gemstone, create a script file for the LED blink operation.led-blink.sh
file using the nano
text editor in the terminal interface.
led-blink.sh
file.
CTRL+X
, then Y
to exit the nano editor and save the file.
1.3. Running the Shell Script
Make theled-blink.sh
file executable using the chmod
command.
led-blink.sh
script.
LED blink application
2. Reading a Button and Turning on an LED
2.1. GPIO Connections
Connect the LED to GPIOX and the button to GPIOY on the Gemstone, as shown below.
LED and Button Connection
2.2. Creating a Shell Script
Create the script file.button-led.sh
file using the nano
text editor in the terminal interface.
button-led.sh
file.
Press CTRL+X
, then Y
to exit the nano editor and save the file.
2.3. Running the Shell Script
Make thebutton-led.sh
file executable using the chmod
command.
button-led.sh
script.
Turning on an LED with a button