Analog Sensors

  1. First, make sure you have the PiShield installed and sensors plugged into the correct ports.
  2. If using the pre-configured system image, simply go to the dev folder in the home directory (~/dev) and skip to step 5 below.
  3. If setting up from a clean Raspberry Pi image, make sure you follow these steps to configure the Pi first
  4. Download the C code examples from our github repository, and type make all
  5. Run the spi-read8 program by typing ./spi-read8
  6. You should see the 8 analog port values being polled:

analog-test

Here is a video showing a SlideRound connected to the first channel of the shield:


Digital Sensors

I-CubeX Sensors:

  • Follow steps 1-4 above, and run either the orient3d, magnetic3d, or movearound programs to see data from these sensors.

digital-test

Other Sensors:

  • The board can be used with any 5V I2C sensor, and the pinout is as follows (looking into the PiShield connector).
  • Power Power
    SDA SCL
    Ground Ground
  • Make sure you know the I2C address of the sensor, and the way the data is to be read. For reference take a look at the code for the orient3d where the sensor data is a series of register read commands. Many I2C sensors are easily accessed, but for some (the magnetic3d  for example), things are a bit more complicted, and includes:
  1. A write command to configure the sensor
  2. A slight delay (6ms) between readings as per sensor specifications
  3. A write followed by a read to read a sensor value
  4. Some processing afterwards to repack the data into usable values