2024-07-19 -
This commit is contained in:
parent
56a9db3691
commit
66b2444317
Binary file not shown.
@ -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...")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user