# main.py - MicroPython version without HID
import time
from machine import Pin
# GP7 as input with pull-up
pir = Pin(7, Pin.IN, Pin.PULL_UP)
last_state = pir.value()
while True:
current_state = pir.value()
if current_state and not last_state:
print("Mouvement détecté")
# ici, dans Wokwi, on ne peut pas envoyer de touche ENTER au PC
time.sleep(2)
last_state = current_state
time.sleep(0.05)