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

Beginners • Re: GPIO to control led

$
0
0
This sets GPIO17 on (and it stays on when python script exits)

Code:

import gpiodfrom gpiod.line import Direction, ValueLINE = 17with gpiod.request_lines(    "/dev/gpiochip4",    consumer="example",    config={        LINE: gpiod.LineSettings(            direction=Direction.OUTPUT, output_value=Value.ACTIVE        )    },) as request:    request.set_value(LINE, Value.ACTIVE)

Statistics: Posted by neilgl — Wed Jul 17, 2024 12:11 pm



Viewing all articles
Browse latest Browse all 5045

Trending Articles