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
Meanvalue.cpp@9:1655d67d8a53, 2015-10-07 (annotated)
- Committer:
- Bartvaart
- Date:
- Wed Oct 07 13:48:19 2015 +0000
- Revision:
- 9:1655d67d8a53
- Parent:
- 5:b400209df739
- Child:
- 10:897db0bdb2fe
werkt niet met gemiddelde;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Bartvaart | 4:3b9e2d49d5fb | 1 | #include "Meanvalue.h" |
| Bartvaart | 4:3b9e2d49d5fb | 2 | |
| Bartvaart | 9:1655d67d8a53 | 3 | //gemiddelde bepalen |
| Bartvaart | 4:3b9e2d49d5fb | 4 | |
| Bartvaart | 9:1655d67d8a53 | 5 | double Meanvalue(double y, double &sum, double &ymean, int &a, int delay){ |
| Bartvaart | 4:3b9e2d49d5fb | 6 | |
| Bartvaart | 5:b400209df739 | 7 | sum = sum + y; |
| Bartvaart | 5:b400209df739 | 8 | a = a + 1; |
| Bartvaart | 4:3b9e2d49d5fb | 9 | |
| Bartvaart | 5:b400209df739 | 10 | if (a == delay) |
| Bartvaart | 4:3b9e2d49d5fb | 11 | { |
| Bartvaart | 5:b400209df739 | 12 | double ymean = sum / a; |
| Bartvaart | 4:3b9e2d49d5fb | 13 | sum = 0; |
| Bartvaart | 4:3b9e2d49d5fb | 14 | a = 0; |
| Bartvaart | 4:3b9e2d49d5fb | 15 | return ymean; |
| Bartvaart | 4:3b9e2d49d5fb | 16 | } |
| Bartvaart | 4:3b9e2d49d5fb | 17 | else{ |
| Bartvaart | 5:b400209df739 | 18 | return ymean; |
| Bartvaart | 4:3b9e2d49d5fb | 19 | } |
| Bartvaart | 9:1655d67d8a53 | 20 | } |
| Bartvaart | 9:1655d67d8a53 | 21 | |
| Bartvaart | 9:1655d67d8a53 | 22 | //double Meansmooth(double y, double &sum, int &a, double &ymean, int delay){ |
| Bartvaart | 9:1655d67d8a53 | 23 | // } |
