Valery Roman
/
Nucleo_pwm
gg wp
Diff: main.cpp
- Revision:
- 0:1b0885c2fe42
--- /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; + } + } + + } +}