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.
main.cpp
- Committer:
- psug
- Date:
- 2020-04-22
- Revision:
- 0:24267d7f2810
File content as of revision 0:24267d7f2810:
#include "mbed.h"
#include "MMA7660.h"
#define PI 3.14159265;
serial PC(USBTX, USBRX);
MMA7660 MMA(p27,p28);
float calculateAngle(float x,float y,float z){
float angle =0;
angle =(y*y) + (z*z);
angle = sqrt(angle);
angle =x/angle;
angle = atan(angle);
angle = angle*180/PI
return anlge;}