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: mbed
Diff: main.cpp
- Revision:
- 8:5ed6685f6edd
- Parent:
- 7:cb07cdb35b6c
- Child:
- 9:cefa177c1353
diff -r cb07cdb35b6c -r 5ed6685f6edd main.cpp
--- a/main.cpp Thu Mar 28 01:07:54 2019 +0000
+++ b/main.cpp Sun Mar 31 20:31:30 2019 +0000
@@ -16,6 +16,9 @@
int main() {
Serial hm10(PA_11, PA_12);
hm10.baud(9600);
+ char prevC;
+
+ DigitalIn mybutton(USER_BUTTON);
DigitalOut enable(PA_13);
enable.write(1);
@@ -27,14 +30,16 @@
//an array of lineSensor pointers params: lineSensor(PinName emitter Pin, PinName reciever Pin, make sure it is from LEFT TO RIGHT
lineSensor* sensorArray[6] = {new lineSensor(PB_9,A0),new lineSensor(PC_11,A1),new lineSensor(PD_2,A2),new lineSensor(PC_10,A3),new lineSensor(PB_8,A4),new lineSensor(PC_12,A5)};
-
+
+ Robot rbt(leftWheel, rightWheel, sensorArray);
+
leftWheel->init2();
rightWheel->init2();
- Robot rbt(leftWheel, rightWheel, sensorArray);
-
rbt.rbtInit();
+ prevC = 'C';
+
while(1)
{
if(hm10.readable())