Skip to main content

gpiozero-sequent-microsystems

Sequent Microsystems Multi-IO / Megaind HAT support for gpiozero, as a separate add-on package. No changes to gpiozero's own source are required — these classes only extend it (PiFactory, PiPin, SmoothedInputDevice), the same mechanism any third-party pin factory uses.

Install

pip install gpiozero-sequent-microsystems

This pulls in gpiozero, plus Sequent Microsystems' smmultiio and smmegaind Python drivers, all from PyPI. You still need the I2C driver stack set up on the host board itself (I2C enabled, build-essential/ i2c-tools) — see Sequent Microsystems' own board documentation for that part. This isn't Raspberry Pi-only: any SBC that exposes an I2C bus works (e.g. a Radxa ROCK 4 SE), via the i2c factory parameter below.

Usage

from gpiozero import LED
from gpiozero_sequent_microsystems import MultiIOFactory, Potentiometer

relay_factory = MultiIOFactory(stack=0, pin_type='relay')
analog_factory = MultiIOFactory(stack=0, pin_type='analog_in')

relay = LED(1, pin_factory=relay_factory)
pot = Potentiometer(1, pin_factory=analog_factory, threshold=0.25)
pot._queue.start()

relay.on()
print(pot.read(), "V")
relay.off()

MegaindFactory works the same way for the Megaind HAT (pin_type='od' or 'opto').

Both factories default to I2C bus 1 (the Raspberry Pi's default bus). On other SBCs where the HATs are wired to a different bus — e.g. bus 7 on a Radxa ROCK 4 SE — pass i2c to select it:

relay_factory = MultiIOFactory(stack=0, pin_type='relay', i2c=7)
od_factory = MegaindFactory(stack=0, pin_type='od', i2c=7)

pin_type='opto' and pin_type='led' work the same way as 'relay', and can drive gpiozero devices like Button/LED directly:

from gpiozero import Button, LED
from gpiozero_sequent_microsystems import MultiIOFactory

opto_factory = MultiIOFactory(stack=0, pin_type='opto')
led_factory = MultiIOFactory(stack=0, pin_type='led')

button = Button(1, pin_factory=opto_factory)
status_led = LED(1, pin_factory=led_factory)

button.when_pressed = status_led.on
button.when_released = status_led.off

For channel families that don't fit gpiozero's pin model (analog outputs, current loops, RTD probes, servo, motor, quadrature encoders), the factory exposes lightweight wrapper objects instead, bypassing the Pin machinery entirely:

servo = relay_factory.servo(channel=1)
servo.value = -45.0  # % position, range [-140..140]

rtd = relay_factory.rtd(channel=1)
print(rtd.temperature, "C", rtd.resistance, "ohm")

MegaindFactory has the same full set of wrapper methods for the Megaind HAT (led(), analog_in(), analog_out(), current_in(), current_out(), plus board-level rtc(), watchdog() and one_wire_bus()):

from gpiozero_sequent_microsystems import MegaindFactory

od_factory = MegaindFactory(stack=0, pin_type='od')

led = od_factory.led(channel=1)
led.on()

# differential=True reads -10..10V instead of 0..10V
analog = od_factory.analog_in(channel=1, differential=True)
print(analog.value, analog.volts, "V")

current = od_factory.current_out(channel=1)
current.milliamps = 12.0

rtc = od_factory.rtc()
print(rtc.datetime)

watchdog = od_factory.watchdog()
watchdog.period = 60
watchdog.reload()

bus = od_factory.one_wire_bus()
for sensor in bus:
    print(sensor.temperature, "C")

MegaindFactory also exposes read-only board diagnostics as properties: firmware_version, raspberry_voltage, power_voltage, cpu_temperature.

Examples

The examples/ directory has runnable scripts demonstrating both HATs, each verified against real hardware. Each board also gets its own standalone example, so you don't need both HATs to try one out:

  • relay_potentiometer.py (Multi-IO only) — reads a potentiometer and switches a relay on/off around a voltage threshold.
  • led_array_flash.py (Multi-IO only) — chases the status LEDs one at a time, then flashes them all together via the bulk bitmask helpers.
  • megaind_analog_pwm_threshold.py (Megaind only) — reads Megaind's own analog input to dim a PWM LED and drive a threshold indicator.
  • megaind_led_flash.py (Megaind only) — the Megaind counterpart to led_array_flash.py.
  • dual_relay_pwm_led.py (both boards) — a potentiometer on the Multi-IO HAT drives a Megaind PWM LED and a pair of Multi-IO relays.

Run any of them directly, e.g.:

python examples/relay_potentiometer.py

Metadata

Release files for gpiozero-sequent-microsystems 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gpiozero-sequent-microsystems 0.1.0
File Size Uploaded Provenance Actions
gpiozero_sequent_microsystems-0.1.0.tar.gz 28.7 kB Without provenance Details for gpiozero_sequent_microsystems-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpiozero-sequent-microsystems 0.1.0
File Interpreter ABI Platform Actions
gpiozero_sequent_microsystems-0.1.0-py3-none-any.whl Python 3 none any Details for gpiozero_sequent_microsystems-0.1.0-py3-none-any.whl

Total release size: 43.3 kB

Release files / gpiozero_sequent_microsystems-0.1.0.tar.gz

Download URL gpiozero_sequent_microsystems-0.1.0.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
71b448a2d708afe9a9b9b925b7f7c9a9874b5d0d5f84dcceffa0674e8a6a559e
BLAKE2b-256 checksum
How to use checksums
c053aeb0566ba234aefff4cc74d0022c8a925a510a6620965377a1849a34497d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / gpiozero_sequent_microsystems-0.1.0-py3-none-any.whl

Download URL gpiozero_sequent_microsystems-0.1.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc72c4f6aec3066270f4b0696816a7dcbb415a1c412eb60d5533411e8df2ca19
BLAKE2b-256 checksum
How to use checksums
3ce07098a8bc355940d56fb1f56fc912e38f10ec17f8911089ce0e43c355c0dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for gpiozero-sequent-microsystems 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page