Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 2:f5c2fa19497b
- Parent:
- 1:9e727d54e80c
- Child:
- 3:010fde11bfad
--- 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",);