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: M2XStreamClient MMA8451Q SocketModem jsonlite mbed
Fork of M2X_MTS_Accel by
Revision 3:3aa188afd648, committed 2014-08-22
- Comitter:
- mikeflores2000
- Date:
- Fri Aug 22 07:42:15 2014 +0000
- Parent:
- 2:93ca5135c262
- Child:
- 4:8157d7b1cd01
- Commit message:
- version 1.01
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Aug 21 22:45:33 2014 +0000
+++ b/main.cpp Fri Aug 22 07:42:15 2014 +0000
@@ -27,8 +27,8 @@
#define CELL_SHIELD 0
// ssid and phrase for wifi
-std::string ssid = "DevLab"; // Replace with your Wifi ID (SSID)
-std::string phrase = "MultiTech"; // Replace with your Wifi phrase (password)
+std::string ssid = "HD-Members-5Ghz"; // Replace with your Wifi ID (SSID)
+std::string phrase = "hackerdojo"; // Replace with your Wifi phrase (password)
Wifi::SecurityType security_type = Wifi::WPA; // Replace with your Wifi security type
int main()
@@ -120,10 +120,12 @@
y = acc.getAccY();
z = acc.getAccZ();
printf("Accel X: %1.2f, Y: %1.2f, Z: %1.2f\n\r", x, y, z);
-// Calculate pitch and roll. Find the maximum tilt angle. float pitch = atan(x / sqrt(y * y + z * z));
+// Calculate pitch and roll. Find the maximum tilt angle.
+float pitch = atan(x / sqrt(y * y + z * z));
float roll = atan(y / sqrt(x * x + z * z));
float maxTilt =
-max(abs(roll), abs(pitch)) * 180.0 / 3.14159; printf("pitch: %5.1f roll: %5.1f maxTilt: %5.1f\n\r",
+max(abs(roll), abs(pitch)) * 180.0 / 3.14159;
+printf("pitch: %5.1f roll: %5.1f maxTilt: %5.1f\n\r",
pitch, roll, maxTilt);
// If the maximum title is over 20 degrees, then send // data to stream
if (maxTilt > 20) {
@@ -131,5 +133,5 @@
printf("send() returned %d\r\n", ret);
wait(1);
} }
-
+
}
\ No newline at end of file
