aze
Dependencies: mbed C12832 MMA7660
Revision 0:88df3e155441, committed 2018-12-17
- Comitter:
- Ambroisie
- Date:
- Mon Dec 17 15:39:42 2018 +0000
- Commit message:
- amboirise
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Mon Dec 17 15:39:42 2018 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/chris/code/C12832/#7de323fa46fe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA7660.lib Mon Dec 17 15:39:42 2018 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/Sissors/code/MMA7660/#36a163511e34
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Dec 17 15:39:42 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/cd19af002ccc \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test1.cpp Mon Dec 17 15:39:42 2018 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "MMA7660.h" +#include "C12832.h" +MMA7660 MMA(p28, p27); +C12832 lcd(p5, p7, p6, p8, p11); +DigitalOut connectionLed(LED1); +Serial rn42(p9,p10); +float A, alpha; +int main() { + rn42.baud(115200); + if (MMA.testConnection()) + connectionLed = 1; + lcd.cls(); + while(1) { + A=sqrt(MMA.x()*MMA.x()+MMA.y()*MMA.y()+MMA.z()*MMA.z()); + alpha=(360/6.28)*asin(MMA.y()/A); + lcd.locate(0,0); + lcd.printf("alpha: %4.3f",alpha); + rn42.printf("%4.3f\r\n\r\n",alpha); + wait_ms(100); +}} \ No newline at end of file