# crickit/pulse_motor.py

# Demonstrate timed activation of a DC motor connected to the Crickit motor driver.

# Related documentation:
# http://docs.circuitpython.org/projects/crickit/en/latest/
# http://docs.circuitpython.org/projects/seesaw/en/latest/
# https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit

# ----------------------------------------------------------------
# Import standard Python modules.
import time, math

# Import the Crickit interface library.
from adafruit_crickit import crickit

# ----------------------------------------------------------------
# Enter the main event loop.

while True:

    crickit.dc_motor_1.throttle = 1 # full speed forward
    time.sleep(2)

    crickit.dc_motor_1.throttle = 0 # stop
    time.sleep(2)
