![](/media/cache/group/tvz-logo.png.50x50_q85.png)
Simulacija rada semafora s 4 LED diode, 7 segmentog display-a, zvučnika, tipkala i potenciometra
Dependencies: mbed
main.cpp
- Committer:
- dcindric
- Date:
- 2021-05-07
- Revision:
- 1:1b7ec94fe4ab
- Parent:
- 0:2531c2b824f9
File content as of revision 1:1b7ec94fe4ab:
#include "mbed.h" #include "svjetla.h" #include "segmentni.h" #include "buzzer.h" InterruptIn gumbPjesaci(USER_BUTTON); DigitalIn gumbKvar(PC_12); Ticker flipper; Serial pc1(USBTX, USBRX); int main() { int temp = 0; gumbPjesaci.rise(&funkcijaPjesaci); SegConvert(11); while(1) { if(gumbKvar == 1 && temp == 0) { pc1.printf("Semafor u kvaru \n \r"); flipper.attach(&kvar, 0.5); temp++; } else if(gumbKvar == 0) { pc1.printf("Semafor u radu \n \r"); flipper.detach(); semafor(); temp = 0; pc1.printf("\n \r"); } } }