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.
Dependencies: BluetoothSerial SeeedShieldBot mbed
This code shows a simple application composed of a Nucleo board, a Seeed Bot and Seeed Bluetooth shieds:
- http://mbed.org/components/Seeed-Studio-Shield-Robot
- http://mbed.org/components/Seeed-Bluetooth-Shield
This picture shows how the three boards are stacked together:
You will need also to use an application on your phone to send Bluetooth commands and to be able to control the Bot shield. We have used the Bluetooth spp tools pro Android application.
Look at this video to have more details about this demo:
Revision 4:5dd60bfc3cdd, committed 2014-10-24
- Comitter:
- bcostm
- Date:
- Fri Oct 24 08:27:19 2014 +0000
- Parent:
- 3:68fe5b9e069a
- Child:
- 5:de5b38436960
- Commit message:
- Add option to disable the bot front sensors reading (default is enabled, wire A5 to GND to disable it)
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Oct 16 06:18:14 2014 +0000
+++ b/main.cpp Fri Oct 24 08:27:19 2014 +0000
@@ -14,8 +14,11 @@
A0, A1, A2, A3, A4 // Sensors pins (all DigitalIn)
);
+// Disable the feature by wiring A5 to GND
+DigitalIn ReadSensorsEnabled(A5, PullUp);
+
// Enable it for debugging on hyperterminal
-#define DEBUG 1
+#define DEBUG 0
#if DEBUG == 1
Serial pc(PC_10, PC_11);
#define PC_DEBUG(args...) pc.printf(args)
@@ -104,10 +107,10 @@
bot.right(speed);
wait(0.2);
bot.stopAll();
-
+
while (1) {
// Stop the motors if a sensor has detected something.
- if (!bot.rightSensor || !bot.inRightSensor || !bot.centreSensor || !bot.inLeftSensor || !bot.leftSensor)
+ if ((!bot.rightSensor || !bot.inRightSensor || !bot.centreSensor || !bot.inLeftSensor || !bot.leftSensor) && ReadSensorsEnabled)
{
if (!stop) bot.stopAll();
stop = 1;