Change raw_input to input for python3

This commit is contained in:
Michael Pivato
2019-04-24 11:00:07 +09:30
parent 87b21944c8
commit 793aa767d3

View File

@@ -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
print("You have selected manual option so give a value between 0 and you max value")
while True:
inp = raw_input()
inp = input()
if inp == "stop":
stop()
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
pi.set_servo_pulsewidth(ESC, 0)
print("Disconnect the battery and press Enter")
inp = raw_input()
inp = input()
if inp == '':
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")
inp = raw_input()
inp = input()
if inp == '':
pi.set_servo_pulsewidth(ESC, min_value)
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")
while True:
pi.set_servo_pulsewidth(ESC, speed)
inp = raw_input()
inp = input()
if inp == "q":
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()
#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":
manual_drive()
elif inp == "calibrate":