Raspberry Pi 4 Basic GPIO Tutorial with Python

Publié le: 07 mars 2020
sur la chaîne: Ace1000ks1975
3,418
31

▒░█▀▓▒█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▒░█▀▓▒
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Synopsis]

This video will show you how to connect GPIO pins to a Raspberry Pi 4 single board to a breadboard to create a simple circuit.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

[Code used in video]
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄

[In the terminal]

Go to the terminal first
sudo python //Get into the python shell
import RPi.GPIO as GPIO //Import the GPIO library to your computer
GPIO.setmode(GPIO.BOARD) //Setting the pin numbering system to board.
GPIO.setup(11,GPIO.OUT) //Setting pin 11 as an output function
GPIO.output(11,1) //Green led light is on. 1 is on in binary
GPIO.output(11,0) //Green led light is off. 0 is off in binary

GPIO.output(11,True) //Green led light is on. True is on.
GPIO.output(11,False) //Green led light is off. False is off.
GPIO.cleanup() //Clear out the pins that you used
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
nano OnOff.py

import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
green=11
GPIO.setup(green,GPIO.OUT)
GPIO.output(green,True)
time.sleep(2)
GPIO.output(green,False)
time.sleep(1)
GPIO.output(green,1)
time.sleep(5)
GPIO.output(green,0)
GPIO.cleanup()

Ctrl + O
Enter
Ctrl + X
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Links]

◙ Raspberry Pi 4 Related Videos
• https://he-1000-1975.com/video-direct...
░█▄▓▒█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█░█▄▓▒


Sur cette page du site, vous pouvez voir la vidéo en ligne Raspberry Pi 4 Basic GPIO Tutorial with Python durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ace1000ks1975 07 mars 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,418 fois et il a aimé 31 téléspectateurs. Bon visionnage!