2014 Eurobot fork

Dependencies:   mbed-rtos mbed QEI

Revision:
62:78d99b781f02
Parent:
60:5058465904e0
Child:
63:c2c6269767b8
--- a/main.cpp	Sun Apr 14 10:49:51 2013 +0000
+++ b/main.cpp	Sun Apr 14 12:57:04 2013 +0000
@@ -73,19 +73,34 @@
     Ticker motorcontroltestticker;
     motorcontroltestticker.attach(MotorControl::motor_control_isr, 0.05);
     // ai layer thread
-    Thread aithread(AI::ailayer, NULL, osPriorityNormal, 2048);
+    //Thread aithread(AI::ailayer, NULL, osPriorityNormal, 2048);
     
     // motion layer periodic callback
-    RtosTimer motion_timer(motion::motionlayer, osTimerPeriodic);
-    motion_timer.start(50);
+    //RtosTimer motion_timer(motion::motionlayer, osTimerPeriodic);
+    //motion_timer.start(50);
 
-    Thread printingThread(Printing::printingloop, NULL, osPriorityLow, 2048);
+    //Thread printingThread(Printing::printingloop, NULL, osPriorityLow, 2048);
     
     //while(1){
     //    printf("r:%f, l:%f, t:%f\r\n", right_encoder.getTicks()*ENCODER_M_PER_TICK, left_encoder.getTicks()*ENCODER_M_PER_TICK, SystemTime.read());
     //}
 
     //measureCPUidle(); //repurpose thread for idle measurement
+    
+    MotorControl::set_omegacmd(0);
+    for(float spd = 0.02; spd <= 0.5; spd *= 1.4){
+    
+        MotorControl::set_fwdcmd(spd);
+        
+        Thread::wait(3000);
+        
+        float f = MotorControl::mfwdpowdbg;
+        float r = MotorControl::mrotpowdbg;
+        MotorControl::set_fwdcmd(0);
+        printf("targetspd:%f, fwd:%f, rot:%f\r\n", spd, f, r);
+        Thread::wait(5000);
+    }
+    
     Thread::wait(osWaitForever);
    
 }