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: SDFileSystem mbed
Fork of keiki2016verRtos by
Revision 7:9415448ae9ca, committed 2016-05-20
- Comitter:
- taurin
- Date:
- Fri May 20 12:26:32 2016 +0000
- Parent:
- 6:98a63127aa11
- Child:
- 8:31e07f6ed0f7
- Commit message:
- 5/20 ????;
Changed in this revision
| Fusokukei.h | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Fusokukei.h Fri May 13 07:31:18 2016 +0000
+++ b/Fusokukei.h Fri May 20 12:26:32 2016 +0000
@@ -3,8 +3,9 @@
#include "mbed.h"
+
#define AIR_K 0.14737
-#define AIR_N 1.19
+#define AIR_N 1.12
#define AIR_A 1.4314
#define AIR_B 0.209
#define AIR_SUM_NUM 20
@@ -37,7 +38,8 @@
if(air_counter % AIR_SUM_NUM == 0)
air_counter = 0;
airSpeed_ave = make_ave(air_sum, AIR_SUM_NUM);
- airSpeed = airSpeed_ave*AIR_A+AIR_B;
+ //airSpeed = airSpeed_ave*AIR_A+AIR_B;
+ airSpeed=airSpeed_ave;
if(airSpeed > airSpeed_max)
airSpeed_max = airSpeed;
air_counter++;
--- a/main.cpp Fri May 13 07:31:18 2016 +0000
+++ b/main.cpp Fri May 20 12:26:32 2016 +0000
@@ -81,8 +81,8 @@
kisokuServo.period_ms(INIT_SERVO_PERIOD_MS);
geikakuServo.period_ms(INIT_SERVO_PERIOD_MS);
FusokukeiInit();
- MpuInit();
- SdInit();
+ //MpuInit();
+ //SdInit();
//writeDatasTicker.attach(&WriteDatas,1);
//soudaSerial.attach(&DataReceiveFromSouda, Serial::RxIrq);
}
@@ -199,31 +199,32 @@
}
void WriteDatas(){
- int i;
- for(i = 0; i < SOUDA_DATAS_NUM; i++){
- writeDatas[write_datas_index][i] = (float)soudaDatas[i];
- }
- writeDatas[write_datas_index][i++] = calcKXdeg(kx_X.read());
- writeDatas[write_datas_index][i++] = calcKXdeg(kx_Y.read());
- writeDatas[write_datas_index][i++] = calcKXdeg(kx_Z.read());
- writeDatas[write_datas_index][i++] = pitch;
- writeDatas[write_datas_index][i++] = roll;
- writeDatas[write_datas_index][i++] = yaw;
- writeDatas[write_datas_index][i++] = airSpeed;
- //writeDatas[write_datas_index][i++] = writeTimer.read();
- for(i = 0; i < WRITE_DATAS_NUM; i++){
- pc.printf("%f ", writeDatas[write_datas_index][i]);
- twe.printf("%f,", writeDatas[write_datas_index][i]);
- }
- pc.printf("\n\r");
- twe.printf("\n\r");
- if(write_datas_index == SD_WRITE_NUM-1){
- SDprintf();
- write_datas_index=0;
- }
- else{
- write_datas_index++;
- }
+ pc.printf("%f\n\r",airSpeed);
+ //int i;
+// for(i = 0; i < SOUDA_DATAS_NUM; i++){
+// writeDatas[write_datas_index][i] = (float)soudaDatas[i];
+// }
+// writeDatas[write_datas_index][i++] = calcKXdeg(kx_X.read());
+// writeDatas[write_datas_index][i++] = calcKXdeg(kx_Y.read());
+// writeDatas[write_datas_index][i++] = calcKXdeg(kx_Z.read());
+// writeDatas[write_datas_index][i++] = pitch;
+// writeDatas[write_datas_index][i++] = roll;
+// writeDatas[write_datas_index][i++] = yaw;
+// writeDatas[write_datas_index][i++] = airSpeed;
+// //writeDatas[write_datas_index][i++] = writeTimer.read();
+// for(i = 0; i < WRITE_DATAS_NUM; i++){
+// pc.printf("%f ", writeDatas[write_datas_index][i]);
+// twe.printf("%f,", writeDatas[write_datas_index][i]);
+// }
+// pc.printf("\n\r");
+// twe.printf("\n\r");
+ //if(write_datas_index == SD_WRITE_NUM-1){
+// SDprintf();
+// write_datas_index=0;
+// }
+// else{
+// write_datas_index++;
+// }
//for(int i = 0; i < SOUDA_DATAS_NUM; i++){
// pc.printf("%i ",soudaDatas[i]);
// twe.printf("%i ",soudaDatas[i]);
@@ -275,10 +276,10 @@
int main(){
init();
while(1){
- mpuProcessing();
- RollAlarm();
- DataReceiveFromSouda();
+ //uProcessing();
+ // RollAlarm();
+ //taReceiveFromSouda();
WriteDatas();
- WriteServo();
+ //iteServo();
}
}
\ No newline at end of file
