paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [5070] feeding 6 servos - switched to us resolution


From: antoine drouin
Subject: [paparazzi-commits] [5070] feeding 6 servos - switched to us resolution
Date: Fri, 16 Jul 2010 23:55:09 +0000

Revision: 5070
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5070
Author:   poine
Date:     2010-07-16 23:55:09 +0000 (Fri, 16 Jul 2010)
Log Message:
-----------
feeding 6 servos - switched to us resolution

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/lisa/test_servos.c

Modified: paparazzi3/trunk/sw/airborne/lisa/test_servos.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test_servos.c     2010-07-16 23:44:28 UTC 
(rev 5069)
+++ paparazzi3/trunk/sw/airborne/lisa/test_servos.c     2010-07-16 23:55:09 UTC 
(rev 5070)
@@ -47,15 +47,29 @@
 }
 
 static inline void main_periodic( void ) {
-  //  static float foo = 0.;
-  //  foo += 0.001;
-  //  int32_t bar = 9600. * sin(foo);
+  static float foo = 0.;
+  foo += 0.0025;
+  int32_t bar = 1500 + 500. * sin(foo);
+  booz_actuators_pwm_values[0] = bar;
+  booz_actuators_pwm_values[1] = bar;
+  booz_actuators_pwm_values[2] = bar;
+  booz_actuators_pwm_values[3] = bar;
+  booz_actuators_pwm_values[4] = bar;
+  booz_actuators_pwm_values[5] = bar;
+#if 0
   static int32_t foo = 10;
   static int32_t bar = 0;
   bar += foo;
   if (bar > 9600) { foo = -foo; bar = 9600;}
   if (bar < -9600) { foo = -foo; bar = -9600;}
   booz_actuators_pwm_values[0] = 3375 + bar * 1125 / 9600;
+  booz_actuators_pwm_values[1] = 3375 + bar * 1125 / 9600;
+  booz_actuators_pwm_values[2] = 3375 + bar * 1125 / 9600;
+  booz_actuators_pwm_values[3] = 3375 + bar * 1125 / 9600;
+  booz_actuators_pwm_values[4] = 3375 + bar * 1125 / 9600;
+  booz_actuators_pwm_values[5] = 3375 + bar * 1125 / 9600;
+#endif
+
   booz_actuators_pwm_commit();
 
   LED_PERIODIC();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]