Za liniju
joystick.h@1:95b8a1055816, 2017-02-08 (annotated)
- Committer:
- mario_meh
- Date:
- Wed Feb 08 08:29:27 2017 +0000
- Revision:
- 1:95b8a1055816
- Parent:
- 0:bd9f3303564e
Stavljen Joystick destruktor na y_enable pointer tipa Joystick. Biblioteka ima nedostatak ?to nema na?in da upravlja Linijom dok radi neki drugi prekid, npr od tipkala ili nekog od motora
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mario_meh | 0:bd9f3303564e | 1 | #ifndef JOYSTICK_H |
mario_meh | 0:bd9f3303564e | 2 | #define JOYSTICK_H |
mario_meh | 1:95b8a1055816 | 3 | #endif |
mario_meh | 0:bd9f3303564e | 4 | #ifndef MBED_H |
mario_meh | 0:bd9f3303564e | 5 | #include "mbed.h" |
mario_meh | 0:bd9f3303564e | 6 | #endif |
mario_meh | 0:bd9f3303564e | 7 | #ifndef GLOBAL_NAZIVI_H |
mario_meh | 0:bd9f3303564e | 8 | #include "global_nazivi.h" |
mario_meh | 0:bd9f3303564e | 9 | #endif |
mario_meh | 0:bd9f3303564e | 10 | |
mario_meh | 0:bd9f3303564e | 11 | typedef enum { |
mario_meh | 0:bd9f3303564e | 12 | Gore=0,Dolje=1,Lijevo=2,Desno=3, Odabir=4, NijeOdabir = 5, |
mario_meh | 0:bd9f3303564e | 13 | } Kompas; |
mario_meh | 0:bd9f3303564e | 14 | |
mario_meh | 1:95b8a1055816 | 15 | typedef struct { |
mario_meh | 1:95b8a1055816 | 16 | Kompas horizontala; |
mario_meh | 1:95b8a1055816 | 17 | Kompas vertikala; |
mario_meh | 1:95b8a1055816 | 18 | } JoysKompas; |
mario_meh | 0:bd9f3303564e | 19 | |
mario_meh | 0:bd9f3303564e | 20 | class Joystick { |
mario_meh | 0:bd9f3303564e | 21 | public: |
mario_meh | 1:95b8a1055816 | 22 | Joystick(JoysKompas *Data); |
mario_meh | 1:95b8a1055816 | 23 | void YEnable(); |
mario_meh | 1:95b8a1055816 | 24 | void YDisable(); |
mario_meh | 1:95b8a1055816 | 25 | void YStatus(); |
mario_meh | 1:95b8a1055816 | 26 | void promjena(); |
mario_meh | 1:95b8a1055816 | 27 | ~Joystick(); |
mario_meh | 0:bd9f3303564e | 28 | private: |
mario_meh | 0:bd9f3303564e | 29 | AnalogIn _x; |
mario_meh | 0:bd9f3303564e | 30 | AnalogIn _y; |
mario_meh | 1:95b8a1055816 | 31 | Ticker y_ticker; |
mario_meh | 1:95b8a1055816 | 32 | JoysKompas *y_enable; |
mario_meh | 0:bd9f3303564e | 33 | }; |