I checked all the DIO "signal" pins looking for a high anywhere - no drugs found.
- Code: Select all
import PDALib
import time
PDALib.pinMode(6,PDALib.PWM) # init motor1 speed control pin
PDALib.pinMode(7,PDALib.PWM) # init motor2 speed control pin
PDALib.pinMode(12,PDALib.OUTPUT) #init motor1 dirA/Fwd enable
PDALib.pinMode(13,PDALib.OUTPUT) #init motor1 dirB/Bkwd enable
PDALib.pinMode(14,PDALib.OUTPUT) #init motor2 dirA/Fwd enable
PDALib.pinMode(15,PDALib.OUTPUT) #init motor2 dirB/Bkwd enable
# init all direction pins to off
PDALib.digitalWrite(12,0) #set to off/coast
PDALib.digitalWrite(13,0) #set to off/coast
PDALib.digitalWrite(14,0) #set to off/coast
PDALib.digitalWrite(15,0) #set to off/coast
# get ready to go forward
PDALib.digitalWrite(12,1) #set to forward
PDALib.digitalWrite(14,1) #set to forward
# setting speed will start us going (zero to fast in one command for this test)
PDALib.analogWrite(6,127) #set motor1 to half speed
PDALib.analogWrite(7,127) #set motor2 to half speed
There is power 4.93v to the chip on pin 9.
When I ran the above code, my servos on servo1 (servo header pin 0) and servo2 went berserk so I had to disconnect them.
(When not running PDALib and using pigpio_cgi on GPIO4 and GPIO17 the servos responded very nicely. I didn't try using PDALib to move the servos yet. )
PDALib.py didn't set a BCM|GPIO pin mode - does that matter? (I noticed the servopin[] translation to GPIO mode)