Skip to content

Instantly share code, notes, and snippets.

@marcotchella
Created December 1, 2015 10:55
Show Gist options
  • Save marcotchella/3cbe2114b8c920054a37 to your computer and use it in GitHub Desktop.
Save marcotchella/3cbe2114b8c920054a37 to your computer and use it in GitHub Desktop.
Experimento controle de servomotor em 3 posicoes com PWM na placa Intel Galileo GEN 1
'''
Experimento controle de servomotor com PWM
com placa Intel Galileo GEN 1
mais informacoees:
01/12/2015
'''
import mraa
import time
print (mraa.getVersion())
x = mraa.Pwm(9) #seleciona o Pino de GPIO
x.period_ms(7) # efetivamente 4,64 ms
x.enable(True)
x.write(0.30) # periodo ativo 1,4ms
time.sleep( 3 )
while True:
x.write(0.15) # periodo ativo 0,6ms
time.sleep( 3 )
x.write(0.30) # periodo ativo 1,4ms
time.sleep( 3 )
x.write(0.45) # periodo ativo 2ms
time.sleep( 3 )
@marcotchella
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment