Nikola Cvetković
/
19E042PIM_V1_BM_PWM_CYCLE
Program uses USER BUTTON to ciclycally and discretely change luminous intensity of LD2(19E042PIM).
Diff: main.cpp
- Revision:
- 1:35da54fcf004
- Parent:
- 0:c71372aad4e1
diff -r c71372aad4e1 -r 35da54fcf004 main.cpp --- a/main.cpp Thu Oct 14 18:52:24 2021 +0000 +++ b/main.cpp Thu Oct 28 11:03:08 2021 +0000 @@ -40,11 +40,14 @@ */ int main() { - static char ButtonReleased = 0; // Pomocna promenljiva za stanje tastera + // Inicijalizacija i funckije koje se jednom izvrsavaju: + static char ButtonReleased = 0; // Pomocna promenljiva stanja tastera + // Prvo se zada period treperenja diode, a potom trajanje impulsa: DiodicaNaPloci.period_ms(PWM_PERIOD); // Period treperenja traje 4 sekunde DiodicaNaPloci.write(INITIAL_DUTY_CYCLE); // Dioda ukljucena tokom 2 - while (1) + + while (true) { // Ukoliko je taster pritisnut (ima vrednost 0): if ( !TasterNaPloci )