rud2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
LukeMar
Date:
Wed Nov 28 18:48:00 2018 +0000
Parent:
1:9e727d54e80c
Commit message:
rudder 2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Nov 28 15:17:04 2018 +0000
+++ b/main.cpp	Wed Nov 28 18:48:00 2018 +0000
@@ -35,8 +35,9 @@
 DigitalOut   r_dir( p21 );
 DigitalOut    r_I(p23);
 DigitalOut r_slp(p30); //sleep
-float r_ang = 180.0;
-float r_pos = 180.0;
+DigitalOut led(LED1);
+float r_ang;
+float r_pos;
 float RC_1;
 
 //**get position**
@@ -45,24 +46,28 @@
 
 int main(void)
 {
-
+    
     r_I=0;
     rudder.period(.001);
     rudder.pulsewidth(0);
+    r_slp = 0;
+    wait(10);
+    led = 1; //indicate that the wait period is over
+    
     // loop
     while(1) {
         //now = rtos::Kernel::get_ms_count();
         //***JUST ADDED stepper code
 
         if (rx.valid) {
-            RC_1 = rx.channel[0];
+            RC_1 = rx.channel[1];
             pc.printf(" rc: %f\n",rx.channel[0]);
         } else {
             pc.printf(" invalid\r\n");
             r_slp = 0;
         }
         //39.19
-        r_ang = (RC_1/6.77)+39.19;
+        r_ang = (RC_1/6.77)+30.0;
 
         r_pos = (r_ain-.108)/.002466;
         //pc.printf(" %.3f\n",);