This is the basic test you can run after setting up your hardware to see if things are working. This assumes that you have a system image that works, or if you are curious, here are instructions on doing everything from scratch!

Wiring-Pi gpio tool

Since most of the higher level APIs of the PiShield makes use of the excellent WiringPi library, it is not surprising then that you can make use of the basic wiringPi commands. Following are some examples:

Jumpers on PiShield: [picture here]

There are two jumpers, connected to GPIO 2 and GPIO 3 of the Pi, respectively. You can access them via the gpio tool as follows:

gpio mode 2 out #sets GPIO2 (JP1) to output
gpio write 2 1 #sets GPIO2 (JP1) to high
gpio write 2 0 #sets GPIO2 (JP1) to low
gpio mode 3 in #sets GPIO3 (JP2) as input
gpio mode 3 up #turn on internal pullups
(connect a push button to this jumper)
gpio read 3 #returns the value of the switch (0 = closed, 1 = open)

For the full list of possible features, check out the WiringPi gpio documentation

 

Analog to Digital Converter

 

Using the commandline gpio tool, you can access the built in mcp3004 function to read the ports directly:

gpio -x mcp3004:100:0 aread 10X

where X is channels 0-7. for example:

gpio -x mcp3004:100:0 aread 100

will read the first port.

See the C Examples for writing compiled application, as well as I2C sensor access