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: HIDScope MODSERIAL biquadFilter mbed
Revision 2:0c8c3ae5e1b7, committed 2016-11-01
- Comitter:
- laurette
- Date:
- Tue Nov 01 15:47:18 2016 +0000
- Parent:
- 1:83f7e225f7a4
- Commit message:
- Werkt!
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 01 14:44:00 2016 +0000
+++ b/main.cpp Tue Nov 01 15:47:18 2016 +0000
@@ -19,8 +19,6 @@
double Spier1Max;
double Spier2Max;
double Spier3Max;
-int x = 0;
-bool y = true;
// Filter coordinates of lowpass/highpass filter before rectifier and lowpassfilter for the envelope
const double b0_low = 0.2929, b1_low = 0.5858, b2_low = 0.2929, a1_low = 0, a2_low = 0.1716;
@@ -64,7 +62,7 @@
scope.send(); // Sends all channels to the PC at once
}
-float GetMaximumSpier1()
+float GetMaximum1()
{
maximum = Spier1;
for(int i = 0; i<250000;i++)
@@ -82,7 +80,7 @@
return maximum;
}
-float GetMaximumSpier2()
+float GetMaximum2()
{
maximum = Spier2;
for(int i = 0; i<250000;i++)
@@ -100,7 +98,7 @@
return maximum;
}
-float GetMaximumSpier3()
+float GetMaximum3()
{
maximum = Spier3;
for(int i = 0; i<250000;i++)
@@ -118,47 +116,25 @@
return maximum;
}
-void GoOn()
-{
- x++;
- y = false;
- pc.printf("GoOn x=%i en y=%i\n\r",x,y);
-}
-
void StartMeting()
{
- switch(x)
- {
- case 0:
- pc.printf("case 0\n\r");
- y = true;
- while(y == true) {pc.printf("%i",y);}
- break;
- case 1:
- pc.printf("case 1\n\r");
- Spier1Max = GetMaximumSpier1();
- pc.printf("Spier1Max = %f\n\r",Spier1Max);
- y = true;
- while(y == true) {pc.printf("%i",y);}
- break;
- case 2:
- pc.printf("case 2\n\r");
- Spier2Max = GetMaximumSpier2();
- pc.printf("Spier2Max = %f\n\r",Spier2Max);
- y = true;
- while (y == true) {pc.printf("%i",y);}
- break;
- case 3:
- pc.printf("case 3\n\r");
- Spier3Max = GetMaximumSpier3();
- pc.printf("Spier3Max = %f\n\r",Spier3Max);
- y = true;
- while (y == true) {pc.printf("%i",y);}
- break;
- case 4:
- pc.printf("case 4\n\r");
- break;
- }
+ pc.printf("Span de eerste spier aan\n\r");
+ wait(5);
+
+ Spier1Max = GetMaximum1();
+ pc.printf("Spier1Max = %f\n\r",Spier1Max);
+ pc.printf("Span de tweede spier aan\n\r");
+ wait(5);
+
+ Spier2Max = GetMaximum2();
+ pc.printf("Spier2Max = %f\n\r",Spier2Max);
+ pc.printf("Span de derde spier aan\n\r");
+ wait(5);
+
+ Spier3Max = GetMaximum3();
+ pc.printf("Spier2Max = %f\n\r",Spier2Max);
+ pc.printf("Span de derde spier aan\n\r");
+ wait(5);
}
int main()
@@ -170,10 +146,6 @@
pc.baud(115200);
pc.printf("START\n\r");
- knopje1.fall(GoOn);
- StartMeting();
- StartMeting();
- StartMeting();
StartMeting();
pc.printf("Spiermax1 = %f\n\rSpiermax2 = %f\n\rSpier3max = %f\n\r\n\n",Spier1Max,Spier2Max,Spier3Max);