## Espaço de Tecnologias e Artes - Sesc Avenida Paulista ### `hackmd.io/@sesc-av-paulista/estudos-em-python-28-maio` # Grupo de estudos em Python ## 28/5 Experimentações com eletrônica digital e Python - Raspberry Pi ("normal") - Python "normal" (CPython) no Linux com acesso aos GPIOs - https://raspberrytips.com/raspberry-pi-gpio-pins/ - Micropython / CircuitPython - Emuladores de MicroPython https://wokwi.com/micropython - No Thonny: ferra - interpretador especial, reduzido, embarcado em microcontroladores - esp8266 thonny tutorial - https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/ - Raspberry Pi Pico (é um microcontrolador programável) - https://www.raspberrypi.com/products/raspberry-pi-pico/ - [code rasberry](https://pad.education/p/sesc-estudos-em-python) # https://pad.education/p/sesc-estudos-em-python from gpiozero import LED from time import sleep led = LED(17) while True: led.on() sleep(1) led.off() sleep(1) #### versao com tkinter from gpiozero import LED from time import sleep led = LED(17) import tkinter as tk def key_pressed(event): key = event.char print(f'tecla: {key}') if key == 'p': led.on() elif key == 'q': led.off() root = tk.Tk() root.geometry('400x400') label = tk.Label(root, text='Aperte uma tecla') label.pack() root.bind('<KeyPress>', key_pressed) root.mainloop() >>>