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:d021e65ffc99, committed 2021-06-18
- Comitter:
- legrandpaul
- Date:
- Fri Jun 18 15:26:46 2021 +0000
- Commit message:
- programme capteur de son
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 Fri Jun 18 15:26:46 2021 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" +#define N 100 + +Serial pc(USBTX, USBRX); // tx, rx + +//const int pin_SS=A0; +AnalogIn pin_SS(A1); +float valeur,v_son; + + +int main(){ + double tab[N]; + double max = 0; + + while(1){ + + for (int i=0;i<N;i++){ + tab[i]= pin_SS.read();; + } + + max = tab[0]; + for (int j=1;j<N;j++) + { + if(tab[j]>=max) max = tab[j]; + } + + pc.printf("max : %f\n\n \r",max*1000); + wait(0.1); + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jun 18 15:26:46 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file