forked from iandouglas96/engravR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsteppertest.py
More file actions
31 lines (24 loc) · 755 Bytes
/
steppertest.py
File metadata and controls
31 lines (24 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Simple Test Code for Rapsberry Pi Laser Engraver
# Ian D. Miller
# Jan 7, 2014
# http://www.pxlweavr.com
# info [at] pxlweavr.com
print "Program Started"
import RPi.GPIO as GPIO
import Motor_control
from Bipolar_Stepper_Motor_Class import Bipolar_Stepper_Motor
import time
from numpy import pi, sin, cos, sqrt, arccos, arcsin
#Test program for stepper motor
GPIO.setmode(GPIO.BOARD)
GPIO.setup(3,GPIO.OUT)
motor=Bipolar_Stepper_Motor(8,10,12,16)
try:
while True:
direction = int(raw_input("Input Direction: "))
steps = int(raw_input("Input Step Number: "))
laservar = int(raw_input("Laser state: "))
GPIO.output(3,laservar)
motor.move(direction,steps,0.01)
except KeyboardInterrupt:
GPIO.cleanup()