IoT Expansion Cards Digital Inputs

This topic describes how to physically connect a digital input to an IoT expansion board.

Now that you've decided to connect to your IoT Expansion Breadboard, you'll need to:

  1. Take a look at the IoT Expansion Board pin map and decide which GPIO pins you'll use.
  2. Wire up your input and outputs.
  3. Configure the pins via the IO service in Octave.

This tutorial describes how to configure an input pin on an IoT Expansion Board installed in a mangOH Red, and verify that it's working correctly.

📘

Note

For this tutorial you will need a spare jumper or jumper wire.

Locating the Appropriate Pin Map

Review the IoT Expansion Board pin map and identify the input pin you would like to use.

Configuring a Digital Input

The sub sections below describe how to add, configure, and verify a GPIO input on your IoT Expansion Board.

Before continuing, first complete the tutorial on configuring an output GPIO pin, as that pin will bridged and used to drive an input pin for this tutorial.

Adding a GPIO Input

Follow the steps below to configure a digital input pin:

  1. Navigate to Device > Services, locate the GPIO section, and click Configure.
  2. Locate the Add pin section.
  3. Click the Pin drop down and select a GPIO pin (e.g. IOT0_GPIO1).
  4. Note the expected voltage indicated for the pin which will be 1800mV.
  5. (Optional) Change the name in Resource to a more descriptive name.
  6. Ensure the Direction is set to Input.
  7. Set Pull to Up.
  8. Click Add. The configured pin appears in the list of GPIO Services.

Setting the Input Value

Follow the steps below to set the value for the digital input pin by bridging it to the digital output pin configured above:

  1. Ensure that the digital output configured in configuring an output GPIO pin is still producing a voltage of 1800mV.
  2. Using a jumper wire, bridge the output pin with the input pin configured above.
  3. Navigate to Device > Resources
  4. Locate and expand io.
  5. Locate and expand the input pin resource configured in the previous section.
  6. Ensure that the enable property is set to true.
  7. Click the Configured value column for the period property, set the value to 5, and click Set. This sets the polling period to five seconds.
  8. Click the Configured value column for the value property and set it to true.
  9. Wait for the polling period configured in step 7 to elapse, and then verify that the Value column for the input pin's value property toggles from true to false or vice versa. This indicates that the input pin is working correctly.