<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[SoliForum - 3D Printing Community — Using the Azteeg X3 for something other than printing.]]></title>
	<link rel="self" href="https://www.soliforum.com/feed/atom/topic/6471/" />
	<updated>2014-05-20T20:13:27Z</updated>
	<generator>PunBB</generator>
	<id>https://www.soliforum.com/topic/6471/using-the-azteeg-x3-for-something-other-than-printing/</id>
		<entry>
			<title type="html"><![CDATA[Using the Azteeg X3 for something other than printing.]]></title>
			<link rel="alternate" href="https://www.soliforum.com/post/56680/#p56680" />
			<content type="html"><![CDATA[<p>Hello, I&#039;m not sure if this is the best place to post this, but I&#039;m doing so anyway <img src="https://www.soliforum.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" />! I have an Azteeg X3 that I am using to control some stepper motors on a door lock, but for the life of me, I cannot figure out how to code the stepper motor drivers properly. I might not have the right pins or something. Currently, I have a single stepper motor hooked up to the X-Axis and I have a desktop PSU properly supplying power to the board. Anyway, here is the code I am trying:<br /></p><div class="codebox"><pre><code>// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at link

byte directionPin = 28;
byte stepPin = 26;
byte enable = 24;
int numberOfSteps = 100;
byte ledPin = 6;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 25; // milliseconds


void setup() 
{ 

  Serial.begin(9600);
  Serial.println(&quot;Starting StepperTest&quot;);
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
   pinMode(enable, OUTPUT);
  
  digitalWrite(directionPin, HIGH);
  digitalWrite(enable, HIGH);
  for(int n = 0; n &lt; numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n &lt; numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
}

void loop() 
{ 

}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[128keaton]]></name>
				<uri>https://www.soliforum.com/user/5965/</uri>
			</author>
			<updated>2014-05-20T20:13:27Z</updated>
			<id>https://www.soliforum.com/post/56680/#p56680</id>
		</entry>
</feed>
