For use with the Adafruit Motor Shield v2 ----> http://www.adafruit.com/products/1438 ''' from Adafruit_MotorShield import Adafruit_MotorShield from Adafruit_DCMotor import Adafruit_DCMotor import time # Create the motor shield object with the default I2C address AFMS = Adafruit_MotorShield() # Or, create it with a different I2C address (say for stacking) # AFMS = Adafruit_MotorShield(0x61); # Select which 'port' M1, M2, M3 or M4. In this case, M1 myMotor = AFMS.getMotor(1) AFMS.begin() # create with the default frequency 1.6KHz #AFMS.begin(1000); // OR with a different frequency, say 1KHz # Set the speed to start, from 0 (off) to 255 (max speed) myMotor.setSpeed(150); # 10 rpm myMotor.run(Adafruit_DCMotor.FORWARD) # turn on motor myMotor.run(Adafruit_DCMotor.RELEASE) try: while (True): print "tick";
For use with the Adafruit Motor Shield v2 ----> http://www.adafruit.com/products/1438 ''' from Adafruit_MotorShield import Adafruit_MotorShield from Adafruit_DCMotor import Adafruit_DCMotor import time # Create the motor shield object with the default I2C address AFMS = Adafruit_MotorShield() # Or, create it with a different I2C address (say for stacking) # AFMS = Adafruit_MotorShield(0x61); # Select which 'port' M1, M2, M3 or M4. In this case, M1 myMotor = AFMS.getMotor(1) AFMS.begin() # create with the default frequency 1.6KHz #AFMS.begin(1000); // OR with a different frequency, say 1KHz # Set the speed to start, from 0 (off) to 255 (max speed) myMotor.setSpeed(150) # 10 rpm myMotor.run(Adafruit_DCMotor.FORWARD) # turn on motor myMotor.run(Adafruit_DCMotor.RELEASE) try: while (True): print "tick"