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 QEI TextLCD mbed
Fork of TotalControlEmg2 by
Diff: Meanvalue.cpp
- Revision:
- 4:3b9e2d49d5fb
- Child:
- 5:b400209df739
diff -r 344b173f85fe -r 3b9e2d49d5fb Meanvalue.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Meanvalue.cpp Tue Oct 06 14:25:53 2015 +0000
@@ -0,0 +1,21 @@
+#include "Meanvalue.h"
+
+double sum = 0;
+int a = 0;
+
+double Meanvalue(double y){
+
+ double sum = sum + y;
+ int a = a + 1;
+
+ if a == 10
+ {
+ ymean = sum / a;
+ sum = 0;
+ a = 0;
+ return ymean;
+ }
+ else{
+ return 0;
+ }
+ }
\ No newline at end of file
