DigitalIO

Note:

VBOX Touch can use this module with external digital I/O devices. PB Touch also uses this module for some of its hardware functions. MFD Touch cannot use this module.

The VBOX Touch is capable of external input and output to digital devices. This is made easier using the digitalio module.

Currently we use this in a few of the apps available on the store such as Brake Reaction and most PBOX Touch apps. The PBOX Touch apps use this module for some of their hardware functions.

Pin Status

The pin status is returned as a tuple of two booleans (pin0, pin1) which you can get using the get() function.

import digitalio
digitalio.get()

This will return a tuple of booleans which is the status of the first and second pins that are available to the digitalio.

Configuring the digitalio

There are many settings to configure the digitalio with.

Config state

digitalio.intcfg()

This returns a tuple (enabled_high, enabled_low) describing the configured interrupt edges.

Enable DIG_OUT (output to the pin).

digitalio.out0_set(state)

out0_set(state) sets the state of the DIG_OUT output.

Callback.

digitalio.set_callback(callback)

set_callback(callback) sets the function called when a digital input is received.

Pulse per second.

digitalio.pps_enable()

pps_enable(state) takes a bool to enable/disable the 1PPS loopback from GNSS PPS to DIGITALIO1.