Upravljanje unipolasnim motorom

Committer:
mario_meh
Date:
Wed Feb 08 01:22:42 2017 +0000
Revision:
2:b769f13c7523
Parent:
0:a3d5b06d790a
umotor biblioteka, uklonjene if() koje su nepregledne za kod i ote?avaju kori?tenje umotor biblioteke. ; Joystick poku?aj da se rije?i problem sa prekidima na analognom ulazu sa strukturom i tickerom ali i dalje ne pokazuje USB serial ni?ta.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mario_meh 0:a3d5b06d790a 1 #ifndef STEPER_H
mario_meh 0:a3d5b06d790a 2 #define STEPER_H
mario_meh 2:b769f13c7523 3 #ifndef MBED_H
mario_meh 2:b769f13c7523 4 #include "mbed.h"
mario_meh 2:b769f13c7523 5 #endif
mario_meh 2:b769f13c7523 6 #ifndef GLOBAL_NAZIVI_H
mario_meh 2:b769f13c7523 7 #include "global_nazivi.h"
mario_meh 2:b769f13c7523 8 #endif
mario_meh 0:a3d5b06d790a 9
mario_meh 0:a3d5b06d790a 10 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*x))
mario_meh 0:a3d5b06d790a 11 #define BROJ_KORAKA 50
mario_meh 0:a3d5b06d790a 12
mario_meh 2:b769f13c7523 13 typedef struct {
mario_meh 2:b769f13c7523 14 int u_krenuo;
mario_meh 2:b769f13c7523 15 int u_stao;
mario_meh 2:b769f13c7523 16 }UPozicija;
mario_meh 2:b769f13c7523 17
mario_meh 0:a3d5b06d790a 18 class Steper {
mario_meh 0:a3d5b06d790a 19
mario_meh 0:a3d5b06d790a 20 public:
mario_meh 0:a3d5b06d790a 21 Steper();
mario_meh 2:b769f13c7523 22 void stepper_step(int broji);
mario_meh 0:a3d5b06d790a 23 void timer_isr();
mario_meh 0:a3d5b06d790a 24 void u_motor();
mario_meh 2:b769f13c7523 25 void pboneCallback(void);
mario_meh 2:b769f13c7523 26 void UEnable();
mario_meh 2:b769f13c7523 27 UPozicija u_poz;
mario_meh 2:b769f13c7523 28 int Brzina(int okretaja);
mario_meh 0:a3d5b06d790a 29 private:
mario_meh 2:b769f13c7523 30 Timer u_t;
mario_meh 2:b769f13c7523 31 Ticker u_ticker;
mario_meh 0:a3d5b06d790a 32 DigitalOut coil1, coil2, coil3, coil4;
mario_meh 0:a3d5b06d790a 33
mario_meh 0:a3d5b06d790a 34
mario_meh 0:a3d5b06d790a 35 };
mario_meh 0:a3d5b06d790a 36
mario_meh 0:a3d5b06d790a 37 #endif /* STEPER_H */