Stepper motor for grove

Dependencies:   sMotor

Committer:
math991e
Date:
Thu Jan 24 12:55:28 2019 +0000
Revision:
2:7b7c58bb9831
Parent:
0:714a74d01dc3
Comments added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
math991e 0:714a74d01dc3 1 /**
math991e 2:7b7c58bb9831 2 *
math991e 2:7b7c58bb9831 3 * @file steppermotor.h
math991e 2:7b7c58bb9831 4 * @brief make grove steppermotor to turn via analog input.
math991e 2:7b7c58bb9831 5 *
math991e 2:7b7c58bb9831 6 * @author Nikolaj M. & Mathias R.
math991e 2:7b7c58bb9831 7 *
math991e 2:7b7c58bb9831 8 * @date 23/1/2019
math991e 2:7b7c58bb9831 9 *
math991e 2:7b7c58bb9831 10 *-----EXAMPLE-----
math991e 0:714a74d01dc3 11 *#include "steppermotor.h"
math991e 0:714a74d01dc3 12 *steppermotor gate(2200, 200);
math991e 0:714a74d01dc3 13 *
math991e 0:714a74d01dc3 14 *
math991e 0:714a74d01dc3 15 *int main() {
math991e 0:714a74d01dc3 16 * gate.open();
math991e 0:714a74d01dc3 17 * gate.close();
math991e 0:714a74d01dc3 18 *}
math991e 2:7b7c58bb9831 19 *-----EXAMPLE-----
math991e 0:714a74d01dc3 20 **/
math991e 0:714a74d01dc3 21
math991e 2:7b7c58bb9831 22 //PROGRAM: StepperMotor
math991e 0:714a74d01dc3 23
math991e 0:714a74d01dc3 24 #ifndef STEPPERMOTOR
math991e 0:714a74d01dc3 25 #define STEPPERMOTOR
math991e 2:7b7c58bb9831 26 ///StepperMotor CLASS
math991e 0:714a74d01dc3 27 class steppermotor{
math991e 2:7b7c58bb9831 28 ///INITIALIZE VARIABLES USED IN CLASS
math991e 0:714a74d01dc3 29 private:
math991e 0:714a74d01dc3 30 int step_speed;
math991e 0:714a74d01dc3 31 int numstep;
math991e 2:7b7c58bb9831 32 ///FUNCTIONS AND CONSTRUCTOR
math991e 0:714a74d01dc3 33 public:
math991e 0:714a74d01dc3 34 steppermotor(int stepSpeed, int numStep);
math991e 0:714a74d01dc3 35 void setStepSpeed(int stepSpeed);
math991e 0:714a74d01dc3 36 int getStepSpeed();
math991e 0:714a74d01dc3 37 void setNumStep(int numStep);
math991e 0:714a74d01dc3 38 int getNumStep();
math991e 0:714a74d01dc3 39 void open();
math991e 0:714a74d01dc3 40 void close();
math991e 0:714a74d01dc3 41 };
math991e 0:714a74d01dc3 42
math991e 0:714a74d01dc3 43 #endif