Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <Stepper.h>
const int stepsPerRevolution = 3; // change this to fit the number of steps per revolution
const int stepsPerRevolution1 = 3; // change this to fit the number of steps per revolution
// for your motor
long randNumber1;
long randNumber2;
long randNumber3;
long randNumber4;
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
Stepper myStepper1(stepsPerRevolution1, 4, 5, 6, 7);
void setup() {
Serial.begin(9600);
}
void loop() {
randNumber1 = random(1, 1200); // for nelkul
randNumber3 = random(1, 1200); // for nelkul
Serial.println(randNumber1 );
delay(1);
// step one revolution in one direction:
Serial.println("clockwise ");
myStepper.step(randNumber1);
delay(1);
// step one revolution in the other direction:
Serial.println("counterclockwise ");
myStepper.step(-randNumber3);
delay(1); // hogy lass is valamit rajta
// es majd innen kezdi elolrol
randNumber2 = random(1, 1200); // for nelkul
randNumber4 = random(1, 1200); // for nelkul
Serial.println(randNumber2 );
delay(1);
// step one revolution in one direction:
Serial.println("clockwise ");
myStepper1.step(randNumber2);
delay(1);
// step one revolution in the other direction:
Serial.println("counterclockwise ");
myStepper1.step(-randNumber4);
delay(1); // hogy lass is valamit rajta
// es majd innen kezdi elolrol
}