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.
Filtro.cpp@0:f42f18c56a88, 2013-11-16 (annotated)
- Committer:
- pcolla
- Date:
- Sat Nov 16 00:48:19 2013 +0000
- Revision:
- 0:f42f18c56a88
alarma VyV
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| pcolla | 0:f42f18c56a88 | 1 | #include "alarma.h" |
| pcolla | 0:f42f18c56a88 | 2 | #include "mbed.h" |
| pcolla | 0:f42f18c56a88 | 3 | |
| pcolla | 0:f42f18c56a88 | 4 | float smoother = 0; |
| pcolla | 0:f42f18c56a88 | 5 | float f1 = 0; |
| pcolla | 0:f42f18c56a88 | 6 | float f2 = 0; |
| pcolla | 0:f42f18c56a88 | 7 | float f3 = 0; |
| pcolla | 0:f42f18c56a88 | 8 | |
| pcolla | 0:f42f18c56a88 | 9 | float Filtro(void){ |
| pcolla | 0:f42f18c56a88 | 10 | f1 = Valor; |
| pcolla | 0:f42f18c56a88 | 11 | wait(0.2); |
| pcolla | 0:f42f18c56a88 | 12 | f2 = Valor; |
| pcolla | 0:f42f18c56a88 | 13 | wait(0.2); |
| pcolla | 0:f42f18c56a88 | 14 | f3 = Valor; |
| pcolla | 0:f42f18c56a88 | 15 | smoother = (f1 + f2 + f3)/3; |
| pcolla | 0:f42f18c56a88 | 16 | return smoother; |
| pcolla | 0:f42f18c56a88 | 17 | } |