-Vježba 4: Upotrebom digitalnog ulaznog prekidača, kreirajte pulsni valni izlaz koji udvostručuje frekvenciju kada je digitalni ulazni prekidač uključen.
Revision 0:49708e2d3dc1, committed 2015-05-08
- Comitter:
- kkupres
- Date:
- Fri May 08 16:54:27 2015 +0000
- Commit message:
- vje?ba4
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 |
diff -r 000000000000 -r 49708e2d3dc1 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri May 08 16:54:27 2015 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +DigitalOut redled(p5); +DigitalOut greenled(p6); +DigitalIn sw1(p7); +float T=0.2; +int main() { +while(1) { +redled = 1; +greenled = 0; +wait(T); +redled = 0; +greenled = 1; +wait(T); +if (sw1==1) { +T=0.1; +} +if (sw1==0){ + T=0.2; + } +} +}
diff -r 000000000000 -r 49708e2d3dc1 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri May 08 16:54:27 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058 \ No newline at end of file