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

Troubleshooting • Re: Help Rpm Counter inputs

$
0
0
Run this test program for GPIO27

Code:

import gpiodimport timefrom gpiod.line import Direction, ValueLINE = 27with gpiod.request_lines(    "/dev/gpiochip0",    consumer="read-example",    config={ LINE: gpiod.LineSettings(direction=Direction.INPUT) },) as request:    while True:        x = request.get_value(LINE)        time.sleep(1)        print ("GPIO 27 =",x)
In a separate Terminal, enter

Code:

pinctrl set 27 op dhpinctrl set 27 op dh
You should see GPIO 27 go ACTIVE and INACTIVE:

Code:

GPIO 27 = Value.INACTIVEGPIO 27 = Value.ACTIVE

Statistics: Posted by neilgl — Sat Sep 14, 2024 4:08 pm



Viewing all articles
Browse latest Browse all 3980

Trending Articles