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.
Revision 0:c23ba3b2b383, committed 2014-03-31
- Comitter:
- tim004
- Date:
- Mon Mar 31 07:15:41 2014 +0000
- Commit message:
- LV5-Grupa001-Tim004-Zadatak2
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 31 07:15:41 2014 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" +//LV5-Grupa001-Tim004-Zadatak2 + +PwmOut D(dp18); +AnalogIn aIN (dp9); +int main() + { + D.period_us(50); + const int n = 100; + double niz[n] = {0}; + double val = 0.0; + int i = 0; + while (7) + { + niz[i++] = aIN; + if (i == n) + { + double suma = 0.0; + for (int a = 0; a < n; ++a) + suma += niz[a]; + val = suma / double(n); + i = 0; + } + D = val; + wait(0.001); + + + } + } + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Mar 31 07:15:41 2014 +0000 @@ -0,0 +1,1 @@ +http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43 \ No newline at end of file