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 Encoder CruizCore_R1370P
Revision 3:8b9388a6cabe, committed 2019-10-07
- Comitter:
- koheim
- Date:
- Mon Oct 07 13:59:50 2019 +0000
- Parent:
- 2:8ab2c4ec07e7
- Commit message:
- aaa
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 04 14:25:40 2019 +0000
+++ b/main.cpp Mon Oct 07 13:59:50 2019 +0000
@@ -54,21 +54,21 @@
//b is value for going right or left
//count is value for staying right potition of x-axis
{
- if((x - count)*(x - count) < 100) {
+ if((x - count)*(x - count) < 144) {//
RF = 0;
RB = a;
LF = a;
LB = 0;
TF = 0;
TB = 0;
- } else if(x - count >= 10) {
+ } else if(x - count >= 12) {//
RF = 0;
RB = a + b/2;
LF = a;
LB = 0 + b/2;
TF = 0 + b;
TB = 0;
- } else if (x - count <= -10) {
+ } else if (x - count <= -12) {//
RF = 0 + b/2;
RB = a;
LF = a + b/2;
@@ -81,21 +81,21 @@
void go_B(double a,int x,double b,int count)
// b and count are same as go_S
{
- if((x - count)*(x - count) < 100) {
+ if((x - count)*(x - count) < 144) {//
RF = a;
RB = 0;
LF = 0;
LB = a;
TF = 0;
TB = 0;
- } else if(x - count >= 10) {
+ } else if(x - count >= 12) {//
RF = a;
RB = 0 + b/2;
LF = 0;
LB = a + b/2;
TF = 0 + b;
TB = 0;
- } else if (x - count <= -10) {
+ } else if (x - count <= -12) {//
RF = a + b/2;
RB = 0;
LF = 0 + b/2;
@@ -111,7 +111,7 @@
TF = 0;
RF = a/2;
RB = 0;
- LF = a/2;
+ LF = a/4;//
LB = 0;
}
@@ -174,7 +174,7 @@
pc.printf(" y=%d ",count2);
pc.printf(" angle=%8.4f ",angle);
pc.printf("\r\n");
- go_S(0.4,200,0.1,count);
+ go_S(/*0.4*/0.5,200,0.1,count);//
rotation(angle);
}
go_L(0);
@@ -186,7 +186,7 @@
pc.printf(" y=%d ",count2);
pc.printf(" angle=%8.4f ",angle);
pc.printf("\r\n");
- go_S(0.2,200,0.1,count);
+ go_S(/*0.2*/0.3,200,0.1,count);//
rotation(angle);
}
go_L(0);
@@ -250,7 +250,7 @@
pc.printf(" y=%d ",count2);
pc.printf(" angle=%8.4f ",angle);
pc.printf("\r\n");
- go_B(0.4,200,0.1,count);
+ go_B(/*0.4*/0.5,200,0.1,count);//
rotation(angle);
}
go_L(0);
@@ -358,7 +358,8 @@
}
go_L(0);
pc.printf("5\r\n");
- int old_count,old_count2;
+ int old_count;
+ int old_count2;
old_count=EC.getCount();
old_count2=EC2.getCount();
while(count2 < 11800) {