Created
September 18, 2019 14:56
-
-
Save atotto/89239c3778722cdac8d7d134ca3bb73a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import pigpio | |
motor_pin = 18 # GPIO18 (pin12) | |
pi = pigpio.pi() | |
pi.set_mode(motor_pin, pigpio.OUTPUT) | |
pi.set_servo_pulsewidth(motor_pin, 1300) | |
print("please power on ESC") | |
time.sleep(6) | |
pi.set_servo_pulsewidth(motor_pin, 0) | |
print("ready") | |
time.sleep(3) | |
pi.set_servo_pulsewidth(motor_pin, 1300) | |
time.sleep(2) | |
print("run") | |
pi.set_servo_pulsewidth(motor_pin, 1400) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1500) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1550) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1570) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1580) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1600) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1650) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1750) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1580) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 1400) | |
time.sleep(1) | |
pi.set_servo_pulsewidth(motor_pin, 0) | |
print("stop") | |
pi.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment