Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #importar librerias
- from machine import Pin, ADC
- from time import sleep
- def main():
- #definir al pin 32 como entrada analoga
- pot = ADC(Pin(32))
- pot.atten(ADC.ATTN_11DB)
- while(1):
- #alternar el valor del led
- pot_value = pot.read()
- print('Pot: ' + str(pot_value))
- #tiempo de espera
- sleep(0.5)
- #ruta de ejecucion
- if __name__ == "__main__":
- main()
Add Comment
Please, Sign In to add comment