On Progress. Di baca pelan-pelan :'
Dependencies: Motor PID QEI mbed
Fork of Riset-Odometry by
Revision 2:2a1e06b525dc, committed 2016-11-07
- Comitter:
- gustavaditya
- Date:
- Mon Nov 07 12:42:58 2016 +0000
- Parent:
- 1:f79d1d3f4c9a
- Commit message:
- On Progress
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
omniPos.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r f79d1d3f4c9a -r 2a1e06b525dc main.cpp --- a/main.cpp Mon Nov 07 12:38:32 2016 +0000 +++ b/main.cpp Mon Nov 07 12:42:58 2016 +0000 @@ -36,10 +36,10 @@ //~ Dkanan untuk Motor 2 //~ Bkanan untuk Motor 3 //~ Bkiri untuk Motor 4 -omniPos omni1(Dkiri); -omniPos omni2(Dkanan); -omniPos omni3(Bkiri); -omniPos omni4(Bkiri); +omniPos omni1(omniPos::Dkiri); +omniPos omni2(omniPos::Dkanan); +omniPos omni3(omniPos::Bkiri); +omniPos omni4(omniPos::Bkiri); // Inisialisasi Pin TX-RX Joystik dan PC Serial pc(USBTX,USBRX); @@ -51,7 +51,7 @@ * encoder Kanan & Kiri sejajar sumbu X */ float jarak, posX, posY; -float keliling = pi*diameterRoda; +//float keliling = pi*diameterRoda; void detect_encoder() {
diff -r f79d1d3f4c9a -r 2a1e06b525dc omniPos.h --- a/omniPos.h Mon Nov 07 12:38:32 2016 +0000 +++ b/omniPos.h Mon Nov 07 12:42:58 2016 +0000 @@ -2,16 +2,16 @@ #define OMNIPOS_H #include "mbed.h" -#include "QEI.h" +#include "encoderKRAI.h" #define diameterRoda 10 // Deklarasi variabel encoder -// Lebih jelas baca file QEI.h -encoderKRAI encoderDepan( D2, D3, 2000, X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan -encoderKRAI encoderBelakang( D4, D5, 2000, X2_ENCODING); -encoderKRAI encoderKanan( D6, D7, 2000, X2_ENCODING); -encoderKRAI encoderKiri( D8, D9, 2000, X2_ENCODING); +// Lebih jelas baca file encoderKRAI.h +encoderKRAI encoderDepan( D2, D3, 2000, encoderKRAI::X2_ENCODING); //inA, inB, pin Indeks (NC = tak ada), resolusi, pembacaan +encoderKRAI encoderBelakang( D4, D5, 2000, encoderKRAI::X2_ENCODING); +encoderKRAI encoderKanan( D6, D7, 2000, encoderKRAI::X2_ENCODING); +encoderKRAI encoderKiri( D8, D9, 2000, encoderKRAI::X2_ENCODING); class omniPos { public: