ECE 4180 Lab 2 Part 11

Dependencies:   Stepper_Motor_X27168 mbed

Fork of ECE_4180_Lab_4 by Stepper Motor

Committer:
abraha2d
Date:
Tue Oct 09 00:50:58 2018 +0000
Revision:
1:d36b1970cb2f
Parent:
0:71dc3ae7e2eb
Save point

Who changed what in which revision?

UserRevisionLine numberNew contents of line
agarg45 0:71dc3ae7e2eb 1 #include "mbed.h"
agarg45 0:71dc3ae7e2eb 2 #include "StepperMotor_X27168.h"
agarg45 0:71dc3ae7e2eb 3
abraha2d 1:d36b1970cb2f 4 StepperMotor_X27168 smotor(p23, p22, p24, p25);
agarg45 0:71dc3ae7e2eb 5
abraha2d 1:d36b1970cb2f 6 int main()
abraha2d 1:d36b1970cb2f 7 {
abraha2d 1:d36b1970cb2f 8 while (1) {
abraha2d 1:d36b1970cb2f 9 smotor.step_position(180);
abraha2d 1:d36b1970cb2f 10 wait(0.5);
agarg45 0:71dc3ae7e2eb 11
abraha2d 1:d36b1970cb2f 12 smotor.step_position(100);
abraha2d 1:d36b1970cb2f 13 wait(0.5);
abraha2d 1:d36b1970cb2f 14
abraha2d 1:d36b1970cb2f 15 smotor.angle_position(270);
abraha2d 1:d36b1970cb2f 16 wait(0.5);
abraha2d 1:d36b1970cb2f 17
abraha2d 1:d36b1970cb2f 18 smotor.step_position(0);
abraha2d 1:d36b1970cb2f 19 wait(0.5);
abraha2d 1:d36b1970cb2f 20 }
agarg45 0:71dc3ae7e2eb 21 }