API version 2.4

Dependencies:   mbed Map API_E4 3_wheel_vehicule Servo DC_Motor

Files at this revision

API Documentation at this revision

Comitter:
evgeniik
Date:
Tue Jul 07 08:22:07 2020 +0000
Commit message:
Speed control added. In app, gain of speed command is changed.

Changed in this revision

API_E4.lib Show annotated file Show diff for this revision Revisions of this file
Components/3_wheel_vehicule.lib Show annotated file Show diff for this revision Revisions of this file
Components/Motor.lib Show annotated file Show diff for this revision Revisions of this file
Components/Servo.lib Show annotated file Show diff for this revision Revisions of this file
Map.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r e389f98132a4 API_E4.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/API_E4.lib	Tue Jul 07 08:22:07 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/AIMergence/code/API_E4/#5068b3085cb7
diff -r 000000000000 -r e389f98132a4 Components/3_wheel_vehicule.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Components/3_wheel_vehicule.lib	Tue Jul 07 08:22:07 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/AIMergence/code/3_wheel_vehicule/#ad6797baefa9
diff -r 000000000000 -r e389f98132a4 Components/Motor.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Components/Motor.lib	Tue Jul 07 08:22:07 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/AIMergence/code/DC_Motor/#b41bb907727f
diff -r 000000000000 -r e389f98132a4 Components/Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Components/Servo.lib	Tue Jul 07 08:22:07 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/AIMergence/code/Servo/#35a072e075d9
diff -r 000000000000 -r e389f98132a4 Map.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Map.lib	Tue Jul 07 08:22:07 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Generic/code/Map/#dad975e2e150
diff -r 000000000000 -r e389f98132a4 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jul 07 08:22:07 2020 +0000
@@ -0,0 +1,57 @@
+#include <string>
+#include <vector>
+
+#include "mbed.h"
+#include "ConsoleAPI.h"
+#include "Device.h"
+
+#include "Motor.h"
+#include "Servo.h"
+#include "3_wheels_Vehicule.h"
+
+using namespace std;
+
+Serial pc(D1, D0);
+Serial bt(PB_6, PB_7);
+
+Motor m1(PB_4 ,PC_10, PC_12, PA_0, PA_4, PC_3); // Create a L298HBridge object 
+Motor m2(PB_5, PB_2, PB_12, PB_14, PC_7, PC_4); // Create a L298HBridge object
+Motor m3(PC_8, PD_2, PC_11, PC_6, PA_15, PC_2); // Create a L298HBridge object
+
+Servo servo1(PA_1); 
+Servo servo2(PA_10);
+Servo servo3(PA_9);
+
+
+
+void led_switch(void);
+
+/*Ticker time_up;
+ 
+void led_switch() {
+    //pc.printf("%f \t %f \t %f\n",m1.getOut(), m2.getOut(), m3.getOut()); //m1.getOut());
+    //pc.printf("%f \t %f \t %f\n",m1.getCom(), m2.getCom(), m3.getCom());
+}*/
+
+int main() {
+    
+    pc.baud(115200);
+    bt.baud(9600);
+    //Add serial to API
+    ConsoleAPI::add_serial(&pc);
+    ConsoleAPI::add_serial(&bt);
+    
+    servo1.calibrate(0.001,90); //portée de -90 à 90
+    servo2.calibrate(0.001,90);
+    servo3.calibrate(0.001,90);
+    
+    servo1.write(0.5);
+    servo2.write(0.48);
+    servo3.write(0.5);
+    
+    Vehicule3 robot(&m1, &m2, &m3, &servo1, &servo2, &servo3, 0.125);
+    
+    while (1){
+        ConsoleAPI::check_command_line_argument();
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r e389f98132a4 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jul 07 08:22:07 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file