tim010 tim010
/
LV9-Grupa1-Tim010-Z1
Pajić Enil, Irma Jakić
Revision 0:dbdc7637ac2c, committed 2014-05-12
- Comitter:
- tim010
- Date:
- Mon May 12 07:58:25 2014 +0000
- Commit message:
- LV9-Grupa1-Tim010-Z1
Changed in this revision
diff -r 000000000000 -r dbdc7637ac2c MMA8451Q.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA8451Q.lib Mon May 12 07:58:25 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/JoKer/code/MMA8451Q/#2d14600116fc
diff -r 000000000000 -r dbdc7637ac2c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon May 12 07:58:25 2014 +0000 @@ -0,0 +1,18 @@ +//LV9-Grupa1-Tim010-Z1 +#include "mbed.h" +#include "MMA8451Q.h" +//by EnilP@ETF-PAI, 10.05.14, +Ticker T; +Serial PC (USBTX, USBRX); +MMA8451Q ACCEL (PTE25, PTE24, 0x3A); +double eAbs (double Num) {return (Num < 0. ? -Num : Num);} //Ako zatreba za određivanje relativog koordinatnog sistema. +void DoIt () + { + if (!PC.writeable()) return; + PC.printf ("(X, Y, Z) = (%.3f, %.3f, %.3f)\n", ACCEL.getAccX(), ACCEL.getAccY(), ACCEL.getAccZ()); + } +int main() + { + T.attach (&DoIt, 0.5); //Regulirati 0.005, 0.001, 0.01, 0.1 + while (7); + }
diff -r 000000000000 -r dbdc7637ac2c mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon May 12 07:58:25 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776 \ No newline at end of file