-
Notifications
You must be signed in to change notification settings - Fork 19
Manually Controlling GPIO Pins (Pucks)
Alexander Crain edited this page Sep 11, 2023
·
2 revisions
Sometimes, it can be convenient to circumvent the GUI and directly control the GPIO pins on the platforms. This can be done using the following commands while being remotely connected to the platforms. In the following sample code, 428
corresponds to the GPIO pin; changing this number will change with pin you are controlling. Here is a map of the pins, taken from this link:
echo 428 > /sys/class/gpio/export
To write to a pin:
echo out > /sys/class/gpio/gpio428/direction
To Read the state of a pin:
echo in > /sys/class/gpio/gpio428/direction
To set a pin HIGH:
echo 1 > /sys/class/gpio/gpio428/value
To set a pin LOW:
echo 0 > /sys/class/gpio/gpio428/value
ls /sys/class/gpio/
echo 428 > /sys/class/gpio/unexport