You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<imgsrc="https://cdn.sparkfun.com/assets/parts/1/5/0/0/3/16301-SparkFun_Top_pHAT_for_Raspberry_Pi-01.jpg"align="right"width=300alt="SparkFun Top pHAT">
22
+
<imgsrc="https://cdn.sparkfun.com/assets/parts/1/5/7/5/4/16833-SparkFun_Qwiic_Quad_Solid_State_Relay_Kit-01.jpg"align="right"width=300alt="SparkFun Qwiic Solid State Relay">
23
23
24
24
Python module for the Qwiic Relays, Listed below
25
25
*[SparkFun Qwiic Single Relay](https://www.sparkfun.com/products/15093)
@@ -93,57 +93,49 @@ See the examples directory for more detailed use examples.
93
93
94
94
```python
95
95
from__future__import print_function
96
-
importtop_phat_button
96
+
importqwiic_relay
97
97
import time
98
98
import sys
99
99
100
-
myButtons=top_phat_button.ToppHATButton()
100
+
myRelays=qwiic_relay.QwiicRelay()
101
101
102
102
defrunExample():
103
103
104
-
print("\nSparkFun Top pHAT Button Example 1\n")
104
+
print("\nSparkFun Qwiic Relay Example 1\n")
105
105
106
-
ifmyButtons.is_connected() ==False:
107
-
print("The Top pHAT Button device isn't connected to the system. Please check your connection", \
106
+
ifmyRelays.begin() ==False:
107
+
print("The Qwiic Relay isn't connected to the system. Please check your connection", \
108
108
file=sys.stderr)
109
109
return
110
110
111
-
myButtons.pressed_interrupt_enable =False
112
-
myButtons.clicked_interrupt_enable =False
111
+
#Turn on relays one and three
112
+
myRelays.set_relay_on(1)
113
+
myRelays.set_relay_on(3)
114
+
time.sleep(1)
113
115
114
-
whileTrue:
115
-
myButtons.button_pressed #These functions must be called to update button variables to their latest setting
116
-
myButtons.button_clicked #These functions must be called to update button variables to their latest setting
0 commit comments