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:
- 1:974404d7741b
- Parent:
- 0:87273e4cfe1c
--- a/main.cpp Tue Oct 07 04:33:22 2014 +0000
+++ b/main.cpp Fri Oct 10 01:49:48 2014 +0000
@@ -1,9 +1,10 @@
#include "mbed.h"
#define fsr_def 0.05
-#define sence_def 0.15
+#define sence_def 0.05
#define zeroPWM 0.17
-#define pullzero 0.9
+#define pullzero 0.95
+#define powerlevel 0.8 //小さいほど強くなるよ
AnalogIn FSR1(p19);
@@ -26,14 +27,14 @@
void Pull1(float buf){
Sig11 = 0;
Sig12 = 1;
- Pwm1 = 1.0-(buf);
+ Pwm1 = 1.0-(powerlevel*buf*buf);
//Pwm1 = 0.5;
}
void Pull2(float buf){
Sig21 = 0;
Sig22 = 1;
- Pwm2 = 1.0-(buf);
+ Pwm2 = 1.0-(powerlevel*buf*buf);
//Pwm2 = 0.5;
}
@@ -75,7 +76,7 @@
myled1=1;
}
else if(FSR1<FSR2 && abs(FSR1-FSR2)>sence_def){//ギューんって引っ張る動き
- Pull2(1.5*FSR1);
+ Pull2(FSR1);
Brake1();
myled1=0;
}
@@ -92,7 +93,7 @@
myled2=1;
}
else if(FSR2<FSR1&& abs(FSR1-FSR2)>sence_def){
- Pull1(1.5*FSR2);
+ Pull1(FSR2);
Brake2();
myled2=0;
}