TVZ2020
/
Konstrukcijski_LAMPICE
Konstrukcijski rad
Revision 0:89c243df8710, committed 2021-05-06
- Comitter:
- kurton_ing
- Date:
- Thu May 06 19:27:34 2021 +0000
- Commit message:
- a
Changed in this revision
diff -r 000000000000 -r 89c243df8710 LAMPICE.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LAMPICE.lib Thu May 06 19:27:34 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/kurton_ing/code/LAMPICE/#4c714cae8da3
diff -r 000000000000 -r 89c243df8710 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu May 06 19:27:34 2021 +0000 @@ -0,0 +1,49 @@ +#include "mbed.h" +#include "LAMPICE.h" +LAMPICE LED(PC_8, PC_6, PC_5, PA_12, PC_9, PB_8); +Serial pc(USBTX, USBRX); +InterruptIn TIPKALO2(PB_9); +DigitalOut LEDICA1(PC_8); +Ticker serial; + +int x=0; +volatile int n=0; + + + +void brojac(){ + n++; + if(n>2){ + n=0; + } +} + + + +void komunikacija(){ + pc.printf("%d", x); +} + + + +int main() +{ + TIPKALO2.mode(PullDown); + TIPKALO2.rise(&brojac); + serial.attach(&komunikacija, 5); + while(1){ + switch(n){ + case 1: + x = LED.flash(x); + break; + case 2: + LEDICA1=!LEDICA1; + wait(2); + LEDICA1=!LEDICA1; + wait(1); + break; + } + + } + +} \ No newline at end of file
diff -r 000000000000 -r 89c243df8710 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu May 06 19:27:34 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file