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:cdec5eb4a8e2, committed 2016-05-02
- Comitter:
- jomfec
- Date:
- Mon May 02 09:02:30 2016 +0000
- Commit message:
- info2
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exercice1.cpp Mon May 02 09:02:30 2016 +0000 @@ -0,0 +1,14 @@ +/*#include "mbed.h" + +Serial pc(USBTX,USBRX); +AnalogIn Ain(p20); +float ADCdata; +int main(){ + pc.printf("ADC Data Values \n\r"); + while(1){ + ADCdata=Ain.read(); + pc.printf("%g \n\r",ADCdata); + wait(0.5); + } + } + */ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exercice2.cpp Mon May 02 09:02:30 2016 +0000 @@ -0,0 +1,53 @@ +/*#include "mbed.h" +Serial pc(USBTX,USBRX); +AnalogIn Ain(p20); +DigitalOut led1(LED1); +DigitalOut led2(LED2); +DigitalOut led3(LED3); +DigitalOut led4(LED4); +float ADCdata; +int main(){ + while(1){ + ADCdata=Ain.read(); + pc.printf("ADC Data Values : %g \n\r",ADCdata); + wait(0.5); + + if(ADCdata<=0.2){ + + led1.write(0); + led2.write(0); + led3.write(0); + led4.write(0); + + } + else if(ADCdata<=0.4){ + + led1.write(1); + led2.write(0); + led3.write(0); + led4.write(0); + } + else if(ADCdata<=0.6){ + + led1.write(1); + led2.write(1); + led3.write(0); + led4.write(0); + } + else if(ADCdata<=0.8){ + + led1.write(1); + led2.write(1); + led3.write(1); + led4.write(0); + } + else if(ADCdata<=1){ + + led1.write(1); + led2.write(1); + led3.write(1); + led4.write(1); + } + } + } +*/ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exercice3.cpp Mon May 02 09:02:30 2016 +0000 @@ -0,0 +1,15 @@ +/*#include "mbed.h" +AnalogOut Sortie(p18); + +int main(){ + + while(1){ + Sortie.write(0.25); + wait(1); + Sortie.write(0.5); + wait(1); + Sortie.write(0.75); + wait(1); + } + } + */ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exercice4.cpp Mon May 02 09:02:30 2016 +0000 @@ -0,0 +1,14 @@ +/*#include "mbed.h" +AnalogOut Aout(p18); +float i; + +int main(){ + while(1){ + for(i=0;i<1;i=i+0.1){ + Aout.write(i); + wait(0.001); + } + + } + } +*/ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/exercice5.cpp Mon May 02 09:02:30 2016 +0000 @@ -0,0 +1,13 @@ +#include "mbed.h" +AnalogOut Aout(p18); +float i; + +int main(){ + while(1){ + for(i=0;i<=1.05;i=i+0.0001) + { + Aout.write(i); + wait_ms(0.001); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon May 02 09:02:30 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96 \ No newline at end of file