After several maddening errors it occurs to me that there is a problem in my GPIO setup, to wit, RPi.GPIO is failing silently.
To test this theory I got my multimeter, set it to volts, put one probe in ground and another probe in the GPIO port (GPIO 17 in this case) and get 0 volts coming through.
Ordinarily I would think there is a loose conection, or a problem with the board (I am using the Adafruit T-Cobbler http://www.adafruit.com/products/1105 ) but I am able to move a servo with this command (using servoblaster) (which does not use the RPi.GPIO library)
echo p1-22=50 > /dev/servoblaster
My question is - am I testing the GPIO correctly? Is there a better way to test if I am getting any current through the GPIO setup?
The code I am using (Python) is as follows
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
dirPin = 4
stepPin = 17
GPIO.setup(dirPin, GPIO.OUT)
GPIO.setup(stepPin, GPIO.OUT)
for i in range(0, 3):
GPIO.output(dirPin, 1)
GPIO.output(stepPin, 1)
time.sleep(15000)
GPIO.output(dirPin, 1)
GPIO.output(stepPin, 0)
time.sleep(10)
GPIO.setmode(GPIO.BOARD)
(and change pinnumbers to 7 & 11 of course). Pretty weird. Sorry I can't help. – Gerben Dec 9 '13 at 13:45