Upravljanje unipolasnim motorom
umotor.h
- Committer:
- mario_meh
- Date:
- 2017-02-08
- Revision:
- 2:b769f13c7523
- Parent:
- 0:a3d5b06d790a
File content as of revision 2:b769f13c7523:
#ifndef STEPER_H #define STEPER_H #ifndef MBED_H #include "mbed.h" #endif #ifndef GLOBAL_NAZIVI_H #include "global_nazivi.h" #endif #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*x)) #define BROJ_KORAKA 50 typedef struct { int u_krenuo; int u_stao; }UPozicija; class Steper { public: Steper(); void stepper_step(int broji); void timer_isr(); void u_motor(); void pboneCallback(void); void UEnable(); UPozicija u_poz; int Brzina(int okretaja); private: Timer u_t; Ticker u_ticker; DigitalOut coil1, coil2, coil3, coil4; }; #endif /* STEPER_H */