const int drPin=1;
const int stpPin=2;
const int stepsPerRevolution = 200;
void setup() {
// put your setup code here, to run once:
pinMode(drPin, OUTPUT);
pinMode(stpPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
//putar 90 derajat 2 kali kanan
for(int i = 0;i<2;i++){
digitalWrite(drPin,HIGH);
for(int y=0;y<90;y++){
digitalWrite(stpPin, HIGH);
delayMicroseconds(2000);
digitalWrite(stpPin, LOW);
delayMicroseconds(2000);
}
delay(1000);
}
//putaran 180 derajat 2 kali kiri
for(int i = 0;i<2;i++){
digitalWrite(drPin,LOW);
for(int y=0;y<180;y++){
digitalWrite(stpPin, HIGH);
delayMicroseconds(2000);
digitalWrite(stpPin, LOW);
delayMicroseconds(2000);
}
delay(1000);
}
}