Andrija Mijailovic 2020/0388

Dependencies:   mbed

Committer:
tzwell
Date:
Fri Oct 08 15:23:43 2021 +0000
Revision:
0:cfac98129f2f
Child:
1:a79d2ebffe73
First commit; First publish

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tzwell 0:cfac98129f2f 1 /*
tzwell 0:cfac98129f2f 2 * Primer treperenja diode za STM32L476RG napisan
tzwell 0:cfac98129f2f 3 * koristeci mbed.h biblioteku.
tzwell 0:cfac98129f2f 4 *
tzwell 0:cfac98129f2f 5 * Katedra za Elektroniku i digitalne sisteme
tzwell 0:cfac98129f2f 6 * Elektrotehnicki fakultet
tzwell 0:cfac98129f2f 7 * Beograd
tzwell 0:cfac98129f2f 8 *
tzwell 0:cfac98129f2f 9 * Oktobar 2021.
tzwell 0:cfac98129f2f 10 *
tzwell 0:cfac98129f2f 11 */
tzwell 0:cfac98129f2f 12
tzwell 0:cfac98129f2f 13 /*
tzwell 0:cfac98129f2f 14 * Biblioteke za uvoz:
tzwell 0:cfac98129f2f 15 */
tzwell 0:cfac98129f2f 16 #include "mbed.h"
tzwell 0:cfac98129f2f 17
tzwell 0:cfac98129f2f 18 /*
tzwell 0:cfac98129f2f 19 * Definisanje makroa:
tzwell 0:cfac98129f2f 20 */
tzwell 0:cfac98129f2f 21 #define HALF_PERIOD 250
tzwell 0:cfac98129f2f 22 /*
tzwell 0:cfac98129f2f 23 * Globalne promenljive:
tzwell 0:cfac98129f2f 24 */
tzwell 0:cfac98129f2f 25
tzwell 0:cfac98129f2f 26 /*
tzwell 0:cfac98129f2f 27 * Deklaracija funkcija:
tzwell 0:cfac98129f2f 28 */
tzwell 0:cfac98129f2f 29
tzwell 0:cfac98129f2f 30
tzwell 0:cfac98129f2f 31 /*
tzwell 0:cfac98129f2f 32 * Glavna funkcija:
tzwell 0:cfac98129f2f 33 */
tzwell 0:cfac98129f2f 34 int main()
tzwell 0:cfac98129f2f 35 {
tzwell 0:cfac98129f2f 36 // Funkcije koje se jedanput izvrsavaju:
tzwell 0:cfac98129f2f 37 DigitalOut DiodicaNaPloci (LED1); // Kreiranje promenljive diode
tzwell 0:cfac98129f2f 38
tzwell 0:cfac98129f2f 39 // Glavna petlja:
tzwell 0:cfac98129f2f 40 while(true)
tzwell 0:cfac98129f2f 41 {
tzwell 0:cfac98129f2f 42 DiodicaNaPloci = !DiodicaNaPloci; // Negacija prethodne vrednosti
tzwell 0:cfac98129f2f 43 wait_ms(HALF_PERIOD); // Cekanje
tzwell 0:cfac98129f2f 44
tzwell 0:cfac98129f2f 45 }
tzwell 0:cfac98129f2f 46 }
tzwell 0:cfac98129f2f 47
tzwell 0:cfac98129f2f 48
tzwell 0:cfac98129f2f 49 /*
tzwell 0:cfac98129f2f 50 * Definicija funkcija:
tzwell 0:cfac98129f2f 51 */