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.6.tar.gz
(6.9 kB
view details)
File details
Details for the file gpiopico-0.0.6.tar.gz
.
File metadata
- Download URL: gpiopico-0.0.6.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4f25bce390d79938a5d25704e91e969f3971efc876b7f911f5fbeb9bc5b2dfc |
|
MD5 | 7c546c6ee094ea6cce8ae82793fc2210 |
|
BLAKE2b-256 | 708faf2f06555a73ab21eea4fa9d23f082637967deb9a03250a09f8057906a59 |