Rudolf Rumpler
/
embedded_answ_2
accelerometer
Revision 0:045cab440776, committed 2020-08-18
- Comitter:
- rudolf5020
- Date:
- Tue Aug 18 20:17:19 2020 +0000
- Commit message:
- part of question 2
Changed in this revision
diff -r 000000000000 -r 045cab440776 MMA7660.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA7660.lib Tue Aug 18 20:17:19 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/rudolf5020/code/MMA7660/#2eed18ba5f03
diff -r 000000000000 -r 045cab440776 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Aug 18 20:17:19 2020 +0000 @@ -0,0 +1,25 @@ + +#include "mbed.h" +#include "MMA7660.h" + + +MMA7660 MMA(p28, p27); +DigitalOut connectionLed(LED1); + + +int main() { + +if (MMA.testConnection()) //test if accelaretor +connectionLed = 1; + + while(1) { + printf ("%f, %f, %f \r", MMA.x(), MMA.z(), MMA.x()); //read x,y,z + wait(1); + + } + +} + + + +
diff -r 000000000000 -r 045cab440776 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Aug 18 20:17:19 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file