Easy way to connect hardware and use gpio in raspberry pico
Project description
GPIO CONTROL IN RASPBERRY PI PICO
Hardware control
Input Devices
- Touch Sensor
- Potenciometer
- Joystick
- PIR
- LM35
- Nextion Display
Ouput Devices
- LED
- Relay
- Solid state relay
- Motor DC
- RGB
- Servo motor
Descargar paquete
pip install gpiopico
Blink
from gpiopico import Led
from utime import sleep
if __name__=='__main__':
led = Led(pin=0, inverted_logic=True)#common anode
for _ in range(4):
led.on()
sleep(1)
led.off()
sleep(1)
for pwm in range(256):
led.pwm_value(pwm)#0-255
sleep(0.2)
Button
from gpiopico import Led, Button
from utime import sleep
if __name__=='__main__':
led = Led(pin=0, inverted_logic=True)#common anode
button = Button(pin=1)
button.when_pressed = led.on
button.on_hold = led.off
while True:
button.check_state()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gpiopico-0.0.5.tar.gz
(5.7 kB
view details)
File details
Details for the file gpiopico-0.0.5.tar.gz
.
File metadata
- Download URL: gpiopico-0.0.5.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71d254149468072f1fa9f25b84e6e091afa6b27eef54be25db9cb8966affcb9 |
|
MD5 | 613de4f4c2e51a64eacb67681ded4635 |
|
BLAKE2b-256 | c9da226bc120c6e3fa512ac5c27b75aad172890307a603bb48308c6eca2c07a4 |