Para introducir valores con un potenciómetro en una Rpi 1B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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