Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DigitDisplay Motor PID mbed millis
Fork of DagonFly__RoadToJapan_15Mei by
Diff: JoystickPS3.h
- Revision:
- 51:df6391c3fa68
- Parent:
- 32:581d4a2373f0
--- a/JoystickPS3.h Mon May 15 07:08:30 2017 +0000
+++ b/JoystickPS3.h Mon May 15 07:49:13 2017 +0000
@@ -95,7 +95,21 @@
}else { L2sebelum = false;
L2_click = false;
}
-
+
+ if (LY < 100 && LY > 50) {
+ if ( LYpSebelum) { LYp_click = false;
+ } else { LYp_click = true;}
+ LYpSebelum = true;
+ }else { LYpSebelum = false;
+ LYp_click = false;
+ }
+ if (LY > 150 && LY < 200) {
+ if ( LYnSebelum) { LYn_click = false;
+ } else { LYn_click = true;}
+ LYnSebelum = true;
+ }else { LYnSebelum = false;
+ LYn_click = false;
+ }
segitiga_click = (bool)((button_click >> 0) & 0x1);
lingkaran_click = (bool)((button_click >> 1) & 0x1);
silang_click = (bool)((button_click >> 2) & 0x1);
@@ -130,8 +144,11 @@
RL = 0;
button_click = 0;
RL_click = 0;
- R2_click =0;
- L2_click =0;
+ R2_click = 0;
+ L2_click = 0;
+ L3_click = 0;
+ LYp_click = 0;
+ LYn_click = 0;
R2 = 0;
L2 = 0;
RX = 0;
@@ -183,7 +200,7 @@
} else {
idle(); }
// Indikator - Print data pada monitor PC
- // debug.printf("%2x %2x %2x %2x %3d %3d %3d %3d %3d %3d\n\r",button, RL, button_click, RL_click, R2, L2, RX, RY, LX, LY);
+ //debug.printf("%2x %2x %2x %2x %3d %3d %3d %3d %3d %3d\n\r",button, RL, button_click, RL_click, R2, L2, RX, RY, LX, LY);
}
}
@@ -200,8 +217,8 @@
bool kiri_click, kanan_click, atas_click, bawah_click;
bool segitiga_click, lingkaran_click, kotak_click, silang_click;
- bool L1_click, R1_click, L3_click, R3_click, R2_click, L2_click;
- bool R2sebelum,L2sebelum;
+ bool L1_click, R1_click, L3_click, R3_click, R2_click, L2_click, LYp_click, LYn_click;
+ bool R2sebelum, L2sebelum, L3sebelum, LYpSebelum, LYnSebelum;
bool START_click, SELECT_click, PS_click;
protected:
