/* Sample program of stepper motor control through Wytec EduBase board. * The Wytec EduBase board has a motor control device that consists of four * half-bridge circuit. A bipolar stepper motor should have one winding connected * across M1-M2 terminals and the other winding M3-M4. It should work with * a unipolar stepper motor too. * The program turn one revolution in one direction and reverse the direction * for another revolution. * This program uses Stepper library of Energia. */ #include const int stepsPerRevolution = 96; // motor specific number const int PWM12 = 30; const int PWM34 = 39; /* Tiva TM4C123 */ //Stepper myStepper(stepsPerRevolution, PB_0, PB_1, PB_2, PB_3); Stepper myStepper(stepsPerRevolution, 3, 4, 19, 38); void setup() { Serial.begin(9600); myStepper.setSpeed(60); // set the step speed for 60 rpm // enable motor output without pulse width modulation pinMode(PWM34, OUTPUT); pinMode(PWM12, OUTPUT); digitalWrite(PWM34, HIGH); digitalWrite(PWM12, HIGH); } void loop() { // turn motor in one direction for one revolution myStepper.step(stepsPerRevolution); delay(500); // reverse motor direction for one revolution myStepper.step(-stepsPerRevolution); delay(500); }