BeagleIO

I’ve been working on a c library to simplify access to the gpio on the BeagleBone board for use with the robot I am working on. My initial pass at this worked decently but was not as flexible as I had hoped. Over the past week or so I’ve been re-writing the majority of the code as a base class and set of derived classes to handle the various pin functions. So far I have objects to handle accessing analog pins, basic digital gpio I/O, and serial ports. The results of my work can be found at: http://code.google.com/p/beagleio/source/browse/branches.

Share

BealgeBone unexport gpio script

This is a simple bash script, that took way to long to get correct, to unexport all the of exported gpio pins on your BeagleBone board at once.

#!/bin/bash
GPIO=/sys/class/gpio/*
UEXT=/sys/class/gpio/unexport

for file in $GPIO
do
  if [[ $file =~ (.*)(gpio)([0-9]+) ]]
  then
    echo "unexporting gpio${BASH_REMATCH[3]}"
    echo "${BASH_REMATCH[3]}" > $UEXT
  fi
done
Share