![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Pajić Enil, Irma Jakić
Diff: main.cpp
- Revision:
- 0:dbdc7637ac2c
--- /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); + }