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.
Unofficial add-on. This is a community project, not affiliated with, maintained, or endorsed by Sequent Microsystems. For the official Multi-IO HAT and Megaind HAT drivers and documentation, see multiio-rpi and megaind-rpi.
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 toled_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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gpiozero_sequent_microsystems-0.1.1.tar.gz | 28.9 kB | Without provenance | Details for gpiozero_sequent_microsystems-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gpiozero_sequent_microsystems-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for gpiozero_sequent_microsystems-0.1.1-py3-none-any.whl |
Total release size: 43.6 kB
Release files / gpiozero_sequent_microsystems-0.1.1.tar.gz
| Download URL | gpiozero_sequent_microsystems-0.1.1.tar.gz |
|---|---|
| Size | 28.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce9716cc19d669da131750cd0522e9d811f647bdef8d14d0ddcfae8dade16ece
|
|
BLAKE2b-256 checksum How to use checksums |
03fa1005a454218d6d922a649f5b17f8f765ab27b0eac9f34b0fe4a1af7f1568
|
| 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.1-py3-none-any.whl
| Download URL | gpiozero_sequent_microsystems-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
450984000b1e5cae3652dc80b54c4446af12472f672cd9221cf69b52ec9beacf
|
|
BLAKE2b-256 checksum How to use checksums |
9bd29dd4aaa156cc5f12f0b622302e01064c982ac3b1af43b5b902c7cdb5d8c5
|
| 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.1
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.