Hi,
I have a problem with my arduino UNO. I am trying to use a stepper motor called nema17. I can’t upload the code to the arduino.
The circuit schematic i use is on this site (same for the code):
I get this error message:
Arduino: 1.6.13 (Windows 10), Board:“Arduino/Genuino Uno”
De schets gebruikt 1.048 bytes (3%) programma-opslagruimte. Maximum is 32.256 bytes.
Globale variabelen gebruiken 9 bytes (0%) van het dynamisch geheugen. Resteren 2.039 bytes voor lokale variabelen. Maximum is 2.048 bytes.
avrdude: ser_open(): can’t open device “\.\COM3”: Het systeem kan het opgegeven bestand niet vinden.
Probleem bij het uploaden naar het board. Zie http://www.arduino.cc/en/Guide/Troubleshooting#upload voor suggesties.
This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.
The code i use:
/* Simple Stepper Motor Control Exaple Code
*
* by Dejan Nedelkovski, www.HowToMechatronics.com
*
*/
// defines pins numbers
const int stepPin = 3;
const int dirPin = 4;
void setup() {
// Sets the two pins as Outputs
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
}
void loop() {
digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
// Makes 200 pulses for making one full cycle rotation
for(int x = 0; x < 200; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000); // One second delay
digitalWrite(dirPin,LOW); //Changes the rotations direction
// Makes 400 pulses for making two full cycle rotation
for(int x = 0; x < 400; x++) {
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
}
delay(1000);
}