Psi Swarm robot library version 0.9

Fork of PsiSwarmV9 by Psi Swarm Robot

Revision:
8:6c92789d5f87
Parent:
6:b340a527add9
Child:
9:dde9e21030eb
--- a/serial.cpp	Sun Oct 16 11:11:21 2016 +0000
+++ b/serial.cpp	Sun Oct 16 12:54:33 2016 +0000
@@ -273,7 +273,7 @@
             sprintf(subcommand,"%1.5f",dec);
             if(allow_commands) {
                 command_status = 1;
-                set_left_motor_speed(dec);
+                motors.set_left_motor_speed(dec);
             } else command_status = 2;
             break;
         case 2:
@@ -281,7 +281,7 @@
             dec = IF_decode_float(message[1],message[2]);
             sprintf(subcommand,"%1.5f",dec);
             if(allow_commands) {
-                set_right_motor_speed(dec);
+                motors.set_right_motor_speed(dec);
                 command_status = 1;
             } else command_status = 2;
             break;
@@ -291,7 +291,7 @@
             sprintf(subcommand,"%1.5f",dec);
             if(allow_commands) {
                 command_status = 1;
-                forward(dec);
+                motors.forward(dec);
             } else command_status = 2;
             break;
         case 4:
@@ -299,7 +299,7 @@
             sprintf(subcommand,"");
             if(allow_commands) {
                 command_status = 1;
-                brake_left_motor();
+                motors.brake_left_motor();
             } else command_status = 2;
             break;
         case 5:
@@ -307,7 +307,7 @@
             sprintf(subcommand,"");
             if(allow_commands) {
                 command_status = 1;
-                brake_right_motor();
+                motors.brake_right_motor();
             } else command_status = 2;
             break;
         case 6:
@@ -315,7 +315,7 @@
             sprintf(subcommand,"");
             if(allow_commands) {
                 command_status = 1;
-                brake();
+                motors.brake();
             } else command_status = 2;
             break;
         case 7:
@@ -323,7 +323,7 @@
             sprintf(subcommand,"");
             if(allow_commands) {
                 command_status = 1;
-                stop();
+                motors.stop();
             } else command_status = 2;
             break;
         case 8:
@@ -332,7 +332,7 @@
             sprintf(subcommand,"%1.5f",dec);
             if(allow_commands) {
                 command_status = 1;
-                turn(dec);
+                motors.turn(dec);
             } else command_status = 2;
             break;
         case 9:
@@ -342,8 +342,8 @@
             sprintf(subcommand,"L=%1.3f R=%1.3f",l_dec,r_dec);
             if(allow_commands) {
                 command_status = 1;
-                set_left_motor_speed(l_dec);
-                set_right_motor_speed(r_dec);
+                motors.set_left_motor_speed(l_dec);
+                motors.set_right_motor_speed(r_dec);
             } else command_status = 2;
             break;
             // LED COMMANDS