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-1.0.0.tar.gz
(8.5 kB
view hashes)