Skip to main content

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 details)

Uploaded Source

File details

Details for the file gpiopico-1.0.0.tar.gz.

File metadata

  • Download URL: gpiopico-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for gpiopico-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b126b3b79d3d335a669444b07ae785d73e3646b175f11c1d4f48b38c7553e00c
MD5 1b67b5c4a97d0253c11deb54e7639e91
BLAKE2b-256 7c69fb0f4c374c8cdb0b9da90532a62de774f2b1bfd85f562dad7105ef1d2d10

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page