Fixed bug.
This commit is contained in:
Suhayl
2019-12-28 18:41:46 +08:00
parent e6f7b47104
commit ccab0ff9ff
+2 -2
View File
@@ -42,8 +42,8 @@ def mapNUM(value,fromLow,fromHigh,toLow,toHigh):
def motor(ADC):
value = ADC -128
if (value > 0): # make motor turn forward
GPIO.output(motoRPin1,GPIO.HIGH) motoRPin1 output HIHG level
GPIO.output(motoRPin2,GPIO.LOW) motoRPin2 output LOW level
GPIO.output(motoRPin1,GPIO.HIGH) # motoRPin1 output HIHG level
GPIO.output(motoRPin2,GPIO.LOW) # motoRPin2 output LOW level
print ('Turn Forward...')
elif (value < 0): # make motor turn backward
GPIO.output(motoRPin1,GPIO.LOW)