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: AQM0802A HMC6352 MultiSerial PID Servo mbed
Revision 7:81f57b67dff8, committed 2015-03-14
- Comitter:
- lilac0112_1
- Date:
- Sat Mar 14 07:16:46 2015 +0000
- Parent:
- 6:2c9cb40ada59
- Commit message:
- The end...
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Mar 14 01:06:13 2015 +0000
+++ b/main.cpp Sat Mar 14 07:16:46 2015 +0000
@@ -793,26 +793,40 @@
if(LineData!=0){
if(PingData[0]>PingData[1]) LineState[0]=1;
- if(PingData[2]<=30) LineState[1]=1;
+ if(PingData[2]<=60) LineState[1]=1;
switch(LinkBit(0,0,0,0,0,0,LineState[1],LineState[0])&0x03){
case 0:
moving(3);
+ wait(0.25);
break;
case 1:
moving(9);
+ wait(0.25);
break;
case 2:
moving(1);
+ wait(0.5);
break;
case 3:
moving(11);
+ wait(0.5);
break;
default :
break;
}
+
+
+
+ if((PingData[2]<90)){
+
+ moving(6);
+ wait(0.25);
+ continue;
+
+ }
/*if(LastPwm[0]==0){
}
@@ -824,36 +838,52 @@
if(
(!(
(abs( int( int(PingData[0]) - int(PingData[1]) ) ) )
- <= 30
+ <= 20
))
){
-
- if(PingData[0]>PingData[1]){
- moving(9);
- //wait(0.5);
- continue;
- }
- else{
- moving(3);
- //wait(0.5);
- continue;
+ if(
+ (PingData[0]+PingData[1])
+ >= 80
+ ){
+ if(PingData[0]>PingData[1]){
+ moving(9);
+ //wait(0.5);
+ continue;
+ }
+ else{
+ moving(3);
+ //wait(0.5);
+ continue;
+ }
}
}
if(
((
- (abs( int( int(PingData[0]) - int(PingData[1]) ) ) )
- <= 30
- )) &&
- (
- PingData[2]>15
-
- )
+ (abs( int( int(PingData[0]) - int(PingData[1]) ) ) )
+ <= 20
+ ))
){
- moving(6);
- //wait(0.5);
- continue;
+ if(
+ (PingData[0]+PingData[1])
+ >= 140
+ ){
+ if(PingData[2]>25){
+ moving(6);
+ wait(0.1);
+ continue;
+
+ }
+ if(PingData[2]<15){
+ moving(0);
+ wait(0.1);
+ continue;
+
+ }
+
+ }
+
}
@@ -866,7 +896,12 @@
case 3:
case 4:
case 5:
- moving(3);
+ if((PingData[0]<PingData[1])&&(PingData[0]+PingData[1]>=90)){
+ moving(3);
+ }
+ else{
+ moving(9);
+ }
break;
case 7:
@@ -874,10 +909,14 @@
case 9:
case 10:
case 11:
- moving(9);
+ if((PingData[0]>PingData[1])&&(PingData[0]+PingData[1]>=90)){
+ moving(9);
+ }
+ else{
+ moving(3);
+ }
break;
-
case 6:
if(PingData[0]>PingData[1]) moving(7);
else moving(5);