Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 2515

General discussion • pi5 gpio pin voltage not toggling low

$
0
0

Code:

import timeimport gpiodrelaypin=15chip = gpiod.Chip('gpiochip4')Relay_line = chip.get_line(relaypin)Relay_line.request(consumer='relay', type=gpiod.LINE_REQ_DIR_OUT)Relay_line.set_value(0)try:    while True:        Relay_line.set_value(1)        print("Plant is being watered!")        time.sleep(10)        print("Watering is finished!")        Relay_line.set_value(0)        time.sleep(5)except KeyboardInterrupt:    passfinally:    Relay_line.release()
pin 15 voltage value not toggling low

Statistics: Posted by amangupta3548 — Sun Mar 17, 2024 6:03 am



Viewing all articles
Browse latest Browse all 2515

Trending Articles