Skip to content

Instantly share code, notes, and snippets.

@EspaceRaspberryFrancais
Last active July 7, 2019 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EspaceRaspberryFrancais/192cb2d07ce76d0d75b6334dc068f6ce to your computer and use it in GitHub Desktop.
Save EspaceRaspberryFrancais/192cb2d07ce76d0d75b6334dc068f6ce to your computer and use it in GitHub Desktop.
# Initialisation
M1_Vitesse = GPIO.PWM(M1_En, frequence)
M1_Vitesse.start(rapportCyclique) # On entre ici un rapport cyclique entre 0 et 100 (pourcentages)
# Changement des valeurs
M1_Vitesse.ChangeFrequency(frequence)
M1_Vitesse.ChangeDutyCycle(rapportCyclique)
# Arret de la modulation
M1_Vitesse.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment