sparkfun_qwiicquadsolidstaterelay

CircuitPython library for SparkFun Qwiic Quad Solid State Relay Kit (COM-16833).

  • Author(s): Graham Beland, Sept. 2022

Implementation Notes

Hardware:

Software and Dependencies: * Adafruit CircuitPython <https://github.com/adafruit/circuitpython> * Bus Device <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice> * Adafruit CircuitPython firmware for the supported boards: * https://circuitpython.org/downloads

class sparkfun_qwiicquadsolidstaterelay.Sparkfun_QwiicQuadSolidStateRelay(i2c, address=8, debug=False)

CircuitPython class for Sparkfun Qwicc Quad Solid State Relay

Initialize Qwiic Quad Solid State Relay for i2c.

property connected

Check to see of the relay is available. Returns True if successful.

relay_all_off()

Turn all the relays off.

relay_all_on()

Turn all the relays on.

relay_all_toggle()

Toggle all relays.

relay_off(relay_num)

Turn the relay on (1-4).

relay_on(relay_num)

Turn the relay on (1-4).

relay_pwm_get(relay_num)

Gets the value for the slow PWM signal. Can be anywhere from 0(off) to 120(on)

Param

The relay to get the PWM signal of

Returns

The value of the PWM signal, a value between 0 and 120

Return type

bool

relay_pwm_set(relay_num, pwm_value)

Sets the value for the slow PWM signal. Can be anywhere from 0(off) to 120(on) A full cycle takes 1 second.

Param

The relay to set the PWM signal of

Param

The value of the PWM signal, a value between 0 and 120

Returns

successful I2C transaction

Return type

bool

relay_state_get(relay_num)

Returns true if the relay is currently on, and false if it is off. :return: Status of the relay :rtype: bool

relay_toggle(relay_num)

Toggle the relay on (1-4).

set_i2c_address(new_address)

Change the i2c address of Relay and return True if successful. Caution: this new address is stored in non volatile RAM Once this new address is sent you will need to use this new address to change the address back to the default address (0x08) (Valid addresses are within 8-118)