2024-07-19 -
This commit is contained in:
parent
0dc703b531
commit
56a9db3691
Binary file not shown.
@ -28,12 +28,18 @@ sensy_boi.close_port_after_each_call = True
|
||||
|
||||
# GPIO configuration
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(17, GPIO.IN)
|
||||
|
||||
# Define pin numbers
|
||||
PIN_17 = 17
|
||||
|
||||
# Set GPIO
|
||||
GPIO.setup(PIN_17, GPIO.IN)
|
||||
|
||||
try:
|
||||
while True:
|
||||
status_17 = GPIO.input(PIN_17)
|
||||
if GPIO.input(17) == GPIO.HIGH:
|
||||
|
||||
print("Adquiriendo datos...")
|
||||
|
||||
# Read data from multiple registers
|
||||
@ -48,6 +54,7 @@ try:
|
||||
|
||||
client.publish("iiot/"+ myhost +"/temperature", temp)
|
||||
client.publish("iiot/"+ myhost +"/humidity", hum)
|
||||
client.publish(f"iiot/{myhost}/door/pin17", str(status_17))
|
||||
|
||||
# Print the processed data
|
||||
print("-------------------------------------")
|
||||
|
Loading…
Reference in New Issue
Block a user