fastes

Dependencies:   mbed

Fork of mbed_test_fastest_rate by Bo-Jhang Ho

Files at this revision

API Documentation at this revision

Comitter:
mja054
Date:
Mon Feb 10 01:12:28 2014 +0000
Parent:
1:3d1239d55050
Commit message:
scheduler

Changed in this revision

sensors_scheduled.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/sensors_scheduled.cpp	Sun Feb 09 02:18:55 2014 +0000
+++ b/sensors_scheduled.cpp	Mon Feb 10 01:12:28 2014 +0000
@@ -19,17 +19,19 @@
 float accel, magma, light, touch;
 
 int main() {
+        int a, m, l, t = 0, old = 0;
         t.reset();
         t.start();
         while (true){
             int time = t.read_ms();
-            if ( time%10 == 0){
+            pc.printf(" time = %d",time);
+            if (time/100 == 0){
                  accel = acc.getAccX();}
-            if (time%17 == 0){
+            if (time%170 == 0){
                  magma= mag.readVal(MAG_OUT_X_MSB);}
-            if(time%25 == 0){
+            if(time%250 == 0){
                  light = lightSensor.read();}
-            if (time%32 == 0){
+            if (time%320 == 0){
                  touch = tsi.readPercentage();}
             pc.printf(" acc = %f, mag = %f,light = %f,touch = %f\n", accel, magma, light, touch);
             }