# L298N Config/Functions l298nEnblPinNum = 20 l298nIn1PinNum = 21 l298nIn2PinNum = 22 def l298nDsblDriver(enblPinNum): enblPin = gpOutPinDict[str(enblPinNum)] setGpOutPinLow(enblPin) return def l298nSetDirCcw(in1PinNum, in2PinNum): in1Pin = gpOutPinDict[str(in1PinNum)] in2Pin = gpOutPinDict[str(in2PinNum)] setGpOutPinLow(in1Pin) setGpOutPinHigh(in2Pin) return def l298nSetDirCw(in1PinNum, in2PinNum): in1Pin = gpOutPinDict[str(in1PinNum)] in2Pin = gpOutPinDict[str(in2PinNum)] setGpOutPinHigh(in1Pin) setGpOutPinLow(in2Pin) return def l298nMoveFullSpeed(enblPinNum): enblPin = gpOutPinDict[str(enblPinNum)] setGpOutPinHigh(enblPin) return def testL298nV01(): # *** Move L298n + N20 motor at full speed for 4 seconds *** printProgramName() print('Begin testL298nV01(), ...') l298nDsblDriver(l298nEnblPinNum) l298nSetDirCw(l298nIn1PinNum, l298nIn2PinNum) l298nMoveFullSpeed(l298nEnblPinNum) pause(fourSeconds) l298nDsblDriver(l298nEnblPinNum) print('End testL298nV01().') return # *** Sample Test *** testL298nV01() # *** Move L298n + N20 motor at full speed for 4 seconds *** ''' *** Sample Output *** >>> %Run -c $EDITOR_CONTENT ========= ========= ========= ========= ========= ========= ========= ========= *** tmc2225test110.py 2022mar6hkt21:40 *** ========= ========= ========= ========= ========= ========= ========= ========= Begin testL298nV01(), ... End testL298nV01(). >>> '''