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:
- 6:477382219bcf
- Parent:
- 5:f1613df66ceb
- Child:
- 7:cb07cdb35b6c
--- a/main.cpp Mon Mar 25 22:42:31 2019 +0000
+++ b/main.cpp Tue Mar 26 16:19:47 2019 +0000
@@ -14,7 +14,9 @@
//Green D9
//Red D5
int main() {
- Serial pc(USBTX, USBRX);
+ char c;
+ //Serial hm10(PA_11, PA_12);
+ //hm10.baud(9600);
DigitalOut enable(PA_13);
enable.write(1);
@@ -27,24 +29,30 @@
//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)};
- leftWheel->init(1);
+ leftWheel->init2();
- while(leftWheel->returnAngularVelocity()!= 0)
- {
- pc.printf("Stage 1, speed %f\r\n",leftWheel->returnAngularVelocity());
- }
-
- rightWheel->init(1);
- while(rightWheel->returnAngularVelocity() != 0)
- {
- pc.printf("Stage 2, speed %f\r\n",rightWheel->returnAngularVelocity());
- }
- pc.printf("L , speedM%f\r\n",leftWheel->returnMaxAngularVel());
- pc.printf("R , speedM %f\r\n",rightWheel->returnMaxAngularVel());
+ rightWheel->init2();
Robot rbt(leftWheel, rightWheel, sensorArray);
+
+ rbt.rbtInit();
while(1)
{
+
}
-
}
+
+/*
+if(hm10.readable())
+ {
+ c = hm10.getc();
+ if(c=='R')
+ {
+
+ }
+ else if(c=='F')
+ {
+
+ }
+ }
+ */