2024-07-19 -

This commit is contained in:
Adolfo Delorenzo 2024-07-19 14:34:00 -06:00
parent 56a9db3691
commit 66b2444317
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@ -11,7 +11,6 @@ myhost = os.uname()[1]
client = mqtt.Client(myhost) client = mqtt.Client(myhost)
client.connect(mqttBroker, 1883) client.connect(mqttBroker, 1883)
# Modbus configuration # Modbus configuration
mb_address = 1 # Modbus address mb_address = 1 # Modbus address
sensy_boi = minimalmodbus.Instrument('/dev/ttyUSB0', mb_address) sensy_boi = minimalmodbus.Instrument('/dev/ttyUSB0', mb_address)
@ -31,14 +30,16 @@ GPIO.setmode(GPIO.BCM)
# Define pin numbers # Define pin numbers
PIN_17 = 17 PIN_17 = 17
PIN_23 = 23
# Set GPIO # Set GPIO
GPIO.setup(PIN_17, GPIO.IN) GPIO.setup(PIN_17, GPIO.IN)
GPIO.setup(PIN_23, GPIO.IN)
try: try:
while True: while True:
status_17 = GPIO.input(PIN_17) status_17 = GPIO.input(PIN_17)
if GPIO.input(17) == GPIO.HIGH: if GPIO.input(23) == GPIO.HIGH:
print("Adquiriendo datos...") print("Adquiriendo datos...")