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.
Diff: manualMode.h
- Revision:
- 3:8d8c25c556ae
- Parent:
- 1:3ac2087996f3
- Child:
- 6:ca3a74a93ae2
diff -r 738b28f6a04b -r 8d8c25c556ae manualMode.h
--- a/manualMode.h Fri Oct 30 09:21:03 2015 +0000
+++ b/manualMode.h Sat Oct 31 00:30:52 2015 +0000
@@ -1,6 +1,22 @@
#ifndef MANUALMODE_H
#define MANUALMODE_H
+void Call(){
+ mesure_state();
+ if(autoflag){
+ move_following();
+ if(spcount<speed){
+ spcount+=speed/100.0;
+ targ_velocity=spcount;
+ }
+ }
+ #ifdef MESURE
+ if(mesureflag){
+ fprintf(fp_r, "%1.3f %f\r\n",time,velocity);
+ }
+ #endif
+}
+
//赤修正
#ifdef IM920
@@ -54,6 +70,7 @@
{
if(b==7){ /*mode change*/
if(edge7){
+ Com.attach(&Call,RATE);
edge7=0;
autoflag=1;
Indicator4=1;
@@ -64,12 +81,37 @@
flaga=0;
step=114;
CStep=114;
- spcount=speed;
+ spcount=speed;
}
}
else if(b==5){
if(edge5){
edge5=0;
+ resetSwingSpeed = 1;
+ interruptSwingSpeed.attach(&countSwingSpeed, 0.05);
+// targSwingRadVelocity = swingspeed;
+ /*for(float i=0.0;i<0.6;i+=0.01){
+ Motor_swing=i;
+ wait(0.05);
+ }
+ Motor_swing = 0.6;*/
+ }
+ }
+ else if(b==8){
+ if(edge8){
+ edge8=0;
+ enableShoot=1;
+ }
+ }
+ else if(b==9){
+ interruptSwingSpeed.detach();
+ targSwingRadVelocity = 0.0;
+ contSwing.reset();
+ Motor_swing = 0.0;
+ }
+ /*else if(b==5){
+ if(edge5){
+ edge5=0;
sendData(1,4);
}
}
@@ -78,7 +120,7 @@
edge6=0;
sendData(1,5);
}
- }
+ }*/
else if(b==1){ /*L down*/
if(edge1){
edge1=0;