From ccab0ff9ffb99da2d633ab533f300bb343b94a8b Mon Sep 17 00:00:00 2001 From: Suhayl <838119509@qq.com> Date: Sat, 28 Dec 2019 18:41:46 +0800 Subject: [PATCH] Update Fixed bug. --- Code/Python_Code/13.1.1_Motor/Motor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Code/Python_Code/13.1.1_Motor/Motor.py b/Code/Python_Code/13.1.1_Motor/Motor.py index a65a3e3..b0b5a08 100644 --- a/Code/Python_Code/13.1.1_Motor/Motor.py +++ b/Code/Python_Code/13.1.1_Motor/Motor.py @@ -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)