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.
Diff: PS3.cpp
- Revision:
- 3:5640aae53391
- Parent:
- 2:fe29007fb56c
- Child:
- 4:52a4030bed37
--- a/PS3.cpp Mon Sep 26 10:28:39 2016 +0000
+++ b/PS3.cpp Fri Sep 30 12:28:35 2016 +0000
@@ -48,6 +48,14 @@
{
return (*(PS3Data+(button>>4)) >> (button & 0x0f)) & 1;
}
+bool PS3::getSELECTState()
+{
+ return getButtonState(migi) & getButtonState(hidari);
+}
+bool PS3::getSTARTState()
+{
+ return getButtonState(ue) & getButtonState(sita);
+}
int PS3::getRightJoystickXaxis()
{
return (int)PS3Data[5]-64;
@@ -72,4 +80,14 @@
{
return atan2(double(PS3Data[4]*-1+64), double(PS3Data[3]-64))*double(180/PI);
}
+void PS3::printdata()
+{
+ Serial pc(USBTX, USBRX);
+ for(int i = 0; i < 8; i++)
+ {
+ pc.printf("%4d", PS3Data[i]);
+ }
+}
+
+