Benutzer-Werkzeuge

Webseiten-Werkzeuge


gpio_basics

Headline

GPIO Basics

GUI on Pi

Help and instructions

Configure pi

see also https://www.raspberrypi.org/documentation/configuration/device-tree.md

Manual extract

Name:   w1-gpio
Info:   Configures the w1-gpio Onewire interface module.
        Use this overlay if you *don't* need a GPIO to drive an external pullup.
Load:   dtoverlay=w1-gpio,<param>=<val>
Params: gpiopin                 GPIO for I/O (default "4")

        pullup                  Non-zero, "on", or "y" to enable the parasitic
                                power (2-wire, power-on-data) feature


Name:   w1-gpio-pullup
Info:   Configures the w1-gpio Onewire interface module.
        Use this overlay if you *do* need a GPIO to drive an external pullup.
Load:   dtoverlay=w1-gpio-pullup,<param>=<val>
Params: gpiopin                 GPIO for I/O (default "4")

        pullup                  Non-zero, "on", or "y" to enable the parasitic
                                power (2-wire, power-on-data) feature

extpullup GPIO for external pullup (default "5")

edit /boot/config.txt

dtoverlay=w1-gpio,gpiopin=4,pullup=on

Reading Pins

GPIO.setup(3, GPIO.IN)
GPIO.input(3)

Checking GPIO function

test pins
wiringPi/gpio/pintest

gpio_function(channel)

Shows the function of a GPIO channel. For example:

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BOARD)
func = GPIO.gpio_function(pin)

will return a value from: GPIO.INPUT, GPIO.OUTPUT, GPIO.SPI, GPIO.I2C, GPIO.HARD_PWM, GPIO.SERIAL, GPIO.UNKNOWN

gpio_basics.txt · Zuletzt geändert: von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki