Nikola Cvetković
/
19E042PIM_V1_BM_PWM_CYCLE
Program uses USER BUTTON to ciclycally and discretely change luminous intensity of LD2(19E042PIM).
Revision 1:35da54fcf004, committed 2021-10-28
- Comitter:
- tzwell
- Date:
- Thu Oct 28 11:03:08 2021 +0000
- Parent:
- 0:c71372aad4e1
- Commit message:
- Updated comments and code structure
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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 )