filmov
tv
Raspberry Pi 4 Basic GPIO Tutorial with Python

Показать описание
▒░█▀▓▒█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▀█▒░█▀▓▒
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[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
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
green=11
GPIO.setup(green,GPIO.OUT)
GPIO.output(green,True)
GPIO.output(green,False)
GPIO.output(green,1)
GPIO.output(green,0)
GPIO.cleanup()
Ctrl + O
Enter
Ctrl + X
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Links]
◙ Raspberry Pi 4 Related Videos
░█▄▓▒█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█░█▄▓▒
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[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
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
green=11
GPIO.setup(green,GPIO.OUT)
GPIO.output(green,True)
GPIO.output(green,False)
GPIO.output(green,1)
GPIO.output(green,0)
GPIO.cleanup()
Ctrl + O
Enter
Ctrl + X
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[Links]
◙ Raspberry Pi 4 Related Videos
░█▄▓▒█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█▄█░█▄▓▒
Комментарии