Valery Roman
/
Nucleo_pwm
gg wp
Revision 0:1b0885c2fe42, committed 2018-04-03
- Comitter:
- oZGi
- Date:
- Tue Apr 03 11:24:57 2018 +0000
- Commit message:
- body loh;
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 Tue Apr 03 11:24:57 2018 +0000 @@ -0,0 +1,37 @@ +#include "mbed.h" + +DigitalOut led(LED2); + +DigitalIn ButtoIn(D4); + +AnalogOut tri(A2); + + +int main() { + led = 0; + while(1) { + + // if(ButtoIn == 0){ +// //led = 1; +//// wait(1); +// +// tri = tri + 0.1; +// wait_us(1); +// if(tri == 1){ +// tri = 0; +// } +// wait(0.5); +// +// } +// led = 0; + + if(ButtoIn == 1){ + tri = tri +0.1; + wait_us(1); + if(tri == 1){ + tri = 0; + } + } + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Apr 03 11:24:57 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/994bdf8177cb \ No newline at end of file