lucasmcg

Stepper Test Circuit Python

Sep 16th, 2021
671
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import time
  2. import board
  3. from adafruit_motorkit import MotorKit
  4. from adafruit_motor import stepper
  5.  
  6. kit = MotorKit(i2c=board.I2C())
  7.  
  8. while True:
  9.    
  10.    
  11.     for i in range(100):
  12.         kit.stepper2.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)
  13.         time.sleep(0.01)
  14.            
  15.     for i in range(100):
  16.         kit.stepper2.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)
  17.         time.sleep(0.01)
RAW Paste Data