Pourriez vous me dire comment faire pour résoudre ce problème :
j’ai voulu essayer un programme simple : faire scintiller une diode ,le code :
import RPi.GPIO as GPIO
import time
LED_PIN = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_PIN, GPIO.OUT)
try:
while True:
GPIO.output(LED_PIN, GPIO.HIGH) # Allumer la LED
time.sleep(1) # Attendre 1 seconde
GPIO.output(LED_PIN, GPIO.LOW) # Éteindre la LED
time.sleep(1) # Attendre 1 seconde
except KeyboardInterrupt:
print("\nArrêt du programme")
GPIO.cleanup() # Réinitialiser les GPIO
mais en voulant le demarrer , j’ai eu la réponse :
C:/Users/JEAN/AppData/Local/Programs/Python/Python313/python.exe "c:/Users/JEAN/led clign .py"
Traceback (most recent call last):
File "c:\Users\JEAN\led clign .py", line 1, in <module>
import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'
j’ai recherché dans les paquets apt , il y a :
python3-rpi-lgpio/stable,stable,now 0.6-0~rpt1 all [installed]
Compatibility shim for lgpio emulating the RPi.GPIO API
python3-rpi.gpio/stable 0.7.1~a4-1+b4 arm64
Module to control Raspberry Pi GPIO channels (Python 3)
j’ai essayé d’installé :python3-rpi.gpio/stable 0.7.1~a4-1+b4 arm64 : réponse :
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package 0.7.1~a4-1+b4
E: Unable to locate package arm64
Donc pas installé ? pouvez vous me le confirmer ?
j’utilise visuel studio code avec windows, relié a la raspberry
Que puis-je faire?
Merci