coding for the sub

Dependencies:   mbed Motor Servo

Revision:
1:f3f36258eaab
Parent:
0:d59f674faf5e
Child:
4:6feb04db3086
--- a/main.cpp	Tue Oct 09 12:11:51 2018 +0000
+++ b/main.cpp	Tue Oct 09 12:33:36 2018 +0000
@@ -1,8 +1,23 @@
 #include "mbed.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "Motor.h"
+#include "Servo.h"
 /* this is the code for the sub
 */
 
 
+Motor m(p26, p30, p29);
+Servo myservo(p22);
+float pedal;
 
 int main() {
+     while(1){
+    for (pedal=0; pedal<=1 ;pedal+=.25){
+        m.speed(pedal*0.3);
+        pedal = 0;
+        myservo = pedal;
+        //printf("%f", pedal);
+        wait(0.25);
+    }
 }