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@5:b400209df739, 2015-10-07 (annotated)
- Committer:
- Bartvaart
- Date:
- Wed Oct 07 11:10:36 2015 +0000
- Revision:
- 5:b400209df739
- Parent:
- 4:3b9e2d49d5fb
- Child:
- 9:1655d67d8a53
Filterdesigns verwijderen, dan werkt het
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 | 4:3b9e2d49d5fb | 3 | |
| Bartvaart | 5:b400209df739 | 4 | double Meanvalue(double y, double &sum, int &a, double &ymean, int delay){ |
| Bartvaart | 4:3b9e2d49d5fb | 5 | |
| Bartvaart | 5:b400209df739 | 6 | sum = sum + y; |
| Bartvaart | 5:b400209df739 | 7 | a = a + 1; |
| Bartvaart | 4:3b9e2d49d5fb | 8 | |
| Bartvaart | 5:b400209df739 | 9 | if (a == delay) |
| Bartvaart | 4:3b9e2d49d5fb | 10 | { |
| Bartvaart | 5:b400209df739 | 11 | double ymean = sum / a; |
| Bartvaart | 4:3b9e2d49d5fb | 12 | sum = 0; |
| Bartvaart | 4:3b9e2d49d5fb | 13 | a = 0; |
| Bartvaart | 4:3b9e2d49d5fb | 14 | return ymean; |
| Bartvaart | 4:3b9e2d49d5fb | 15 | } |
| Bartvaart | 4:3b9e2d49d5fb | 16 | else{ |
| Bartvaart | 5:b400209df739 | 17 | return ymean; |
| Bartvaart | 4:3b9e2d49d5fb | 18 | } |
| Bartvaart | 4:3b9e2d49d5fb | 19 | } |
