Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Para introducir valores con un potenciómetro en una Rpi 1B
# Script para leer una señal analógica y convertirla en digital
# Raspberry Pi 1
# MCP3008
# https://cdn-shop.adafruit.com/datasheets/MCP3008.pdf
# https://youtu.be/0L6SXoQ68Z8
# https://github.com/macunixs/gpiozero-tutorials/blob/master/mcp3008.py
from gpiozero import MCP3008, PWMLED
from time import sleep
pot = MCP3008(0) # Pot is connected to CH0
led = PWMLED(25)
while True:
led.value = pot.value
sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment