Matthew Marino
/
sailbot_RUDDER2
rud2
Revision 2:f5c2fa19497b, committed 2018-11-28
- 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 |
diff -r 9e727d54e80c -r f5c2fa19497b main.cpp --- 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",);