A program which uses twin DC motors and a lidar to drive a robot controlled by a gamepad through an mbed.

Dependencies:   mbed Motor

Test

This is a test of the repository

Revision:
14:6f3985a23eeb
Parent:
13:1b31916de79e
Child:
15:e012856b3a61
--- a/main.cpp	Fri Nov 22 18:36:10 2019 +0000
+++ b/main.cpp	Sat Nov 23 19:45:07 2019 +0000
@@ -13,7 +13,7 @@
 //BusOut myled(LED1,LED2,LED3,LED4);
 Serial BT(p13,p14);
 Serial pc(USBTX,USBRX);
-DigitalOut led(p15);
+BusOut led(p15,p16,p19,p18);
 
 static XNucleo53L0A1 *board=NULL;
 bool stopMotor = false;
@@ -101,7 +101,7 @@
     BT.attach(&btSerialInterrupt);
     lm.speed(0);
     rm.speed(0);
-    led = 0;
+    led.write(0);
 
     while (1) {
         status = board->sensor_centre->get_distance(&distance);
@@ -110,12 +110,12 @@
             
             if (distance < 300) { // Distance might need to be adjusted
                 stopMotor = true;
-                led = !led;
+                led.write(15*!led.read());
                 wait(.1);    
                 }
             else{
                 stopMotor = false;
-                led = 0;
+                led.write(0);
                 }