Change raw_input to input for python3
This commit is contained in:
@@ -23,7 +23,7 @@ print("calibrate OR manual OR control OR arm OR stop")
|
|||||||
def manual_drive(): #You will use this function to program your ESC if required
|
def manual_drive(): #You will use this function to program your ESC if required
|
||||||
print("You have selected manual option so give a value between 0 and you max value")
|
print("You have selected manual option so give a value between 0 and you max value")
|
||||||
while True:
|
while True:
|
||||||
inp = raw_input()
|
inp = input()
|
||||||
if inp == "stop":
|
if inp == "stop":
|
||||||
stop()
|
stop()
|
||||||
break
|
break
|
||||||
@@ -39,11 +39,11 @@ def manual_drive(): #You will use this function to program your ESC if required
|
|||||||
def calibrate(): #This is the auto calibration procedure of a normal ESC
|
def calibrate(): #This is the auto calibration procedure of a normal ESC
|
||||||
pi.set_servo_pulsewidth(ESC, 0)
|
pi.set_servo_pulsewidth(ESC, 0)
|
||||||
print("Disconnect the battery and press Enter")
|
print("Disconnect the battery and press Enter")
|
||||||
inp = raw_input()
|
inp = input()
|
||||||
if inp == '':
|
if inp == '':
|
||||||
pi.set_servo_pulsewidth(ESC, max_value)
|
pi.set_servo_pulsewidth(ESC, max_value)
|
||||||
print("Connect the battery NOW.. you will here two beeps, then wait for a gradual falling tone then press Enter")
|
print("Connect the battery NOW.. you will here two beeps, then wait for a gradual falling tone then press Enter")
|
||||||
inp = raw_input()
|
inp = input()
|
||||||
if inp == '':
|
if inp == '':
|
||||||
pi.set_servo_pulsewidth(ESC, min_value)
|
pi.set_servo_pulsewidth(ESC, min_value)
|
||||||
print("Wierd eh! Special tone")
|
print("Wierd eh! Special tone")
|
||||||
@@ -66,7 +66,7 @@ def control():
|
|||||||
print("Controls - a to decrease speed & d to increase speed OR q to decrease a lot of speed & e to increase a lot of speed")
|
print("Controls - a to decrease speed & d to increase speed OR q to decrease a lot of speed & e to increase a lot of speed")
|
||||||
while True:
|
while True:
|
||||||
pi.set_servo_pulsewidth(ESC, speed)
|
pi.set_servo_pulsewidth(ESC, speed)
|
||||||
inp = raw_input()
|
inp = input()
|
||||||
|
|
||||||
if inp == "q":
|
if inp == "q":
|
||||||
speed -= 100 # decrementing the speed like hell
|
speed -= 100 # decrementing the speed like hell
|
||||||
@@ -109,7 +109,7 @@ def stop(): #This will stop every action your Pi is performing for ESC ofcourse.
|
|||||||
pi.stop()
|
pi.stop()
|
||||||
|
|
||||||
#This is the start of the program actually, to start the function it needs to be initialized before calling... stupid python.
|
#This is the start of the program actually, to start the function it needs to be initialized before calling... stupid python.
|
||||||
inp = raw_input()
|
inp = input()
|
||||||
if inp == "manual":
|
if inp == "manual":
|
||||||
manual_drive()
|
manual_drive()
|
||||||
elif inp == "calibrate":
|
elif inp == "calibrate":
|
||||||
|
|||||||
Reference in New Issue
Block a user