Using the GPIO through Linux

Pulled from:
https://www.youtube.com/watch?v=WRoXPfHDtMs

The GPIO bus exists as a folder like everything else in the Linux file system.

/sys/class/gpio

Navigate to this folder and ls

export gpiochip0  unexport

Export in this folder is a small program used to establish pins.

This will set up pin 7.

echo -n "7" > export

Once the above command is run it will set up a folder for your pin that you can begin to manipulate.


active_low  direction  edge  power  subsystem  uevent  value

echo -n "strong" > drive    :  still unsure of this command but seems required across the board.

direction will allow you to set input or output
value will allow you to set the value of the pin

Use caution with the number schema.







Comments

Popular Posts