728x90
반응형
General Purpose Input Output(PIO)
- 사용자가 configuration 할 수 있는 pin
# First, update your repositories list:
sudo apt upadate
# Then install the package for Python3:
sudo apt install python3-gpiozero
--
ubuntu@ubuntu:~/test$ sudo apt install python3-gpiozero
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
python3-pigpio
The following NEW packages will be installed:
python3-gpiozero
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 71.8 kB of archives.
After this operation, 444 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 python3-gpiozero arm64 1.4.1-1.2 [71.8 kB]
Fetched 71.8 kB in 2s (39.5 kB/s)
Selecting previously unselected package python3-gpiozero.
(Reading database ... 178649 files and directories currently installed.)
Preparing to unpack .../python3-gpiozero_1.4.1-1.2_arm64.deb ...
Unpacking python3-gpiozero (1.4.1-1.2) ...
Setting up python3-gpiozero (1.4.1-1.2) ...
$ pinout
#!/usr/bin/env python3
#Basic GPIO example
#Author: mnku
from gpiozero import LED
from time import sleep
led = LED(23)
#while True:
# led.on()
# sleep(1)
# led.off()
# sleep(1)
try:
while True:
led.on()
sleep(1)
led.off()
sleep(1)
except KeyboardInterrupt:
led.off()
728x90
반응형
'Firmware & Embedded > SBC' 카테고리의 다른 글
How to set a Static IP Address on Ubuntu 20.04 (0) | 2024.01.02 |
---|---|
Basic I2C Communication tutorial Pi and UNO (0) | 2023.12.31 |
Practical Exercise on Changing CPU Clock Speed (0) | 2023.12.29 |
Checking Pi Processor Information (0) | 2023.12.29 |
Methods for Optimizing Memory to Enhance Pi Performance (0) | 2023.12.29 |