Blinking an LED

gpio via the Shell Command Line and sysfs

Another easy way to do general purpose I/O (gpio) on the Beagle is through a terminal window and a shell prompt. In Linux, almost everything is treated as a file, even things that aren't files. Here we'll use a virtual file system called sysfs. sysfs exposes the drivers for the hardware so you can easily use them.

Blinking an External LED via gpio

In the AM lab we wired an LED to the P9_12 General Purpose IO (gpio) port and controlled it via BoneScript. Here we'll control it via a shell command. First we need to figure out which gpio pin P9_12 is attached to. The following figure shows it attached to gpio_60.

Now experiment around. Can you flash the LED? How fast? Make the LED read the switch.

Analog In

The bone has eight Analog Inputs. Several are exposed on P9. They are labeled AIN in the table below. How many do you find?

The AIN pins are sampled at 12 bits and 100k samples per second. The input voltage is between 0 and 1.8V. Fortunately, both voltages are available on P9.

You've already wired up P9_39 for AIN0 in the AM lab. You interact with the analog in much like the gpio, but it appears in a different place. We have to run a command before the AIN interface appears. Just run them now, later I'll explain what you did if you are interested.