Andrija Mijailovic
/
19E042PIM_T2_2020_0388
Andrija Mijailovic 2020/0388
main.cpp@2:2a4f1bb68811, 2021-11-06 (annotated)
- Committer:
- tzwell
- Date:
- Sat Nov 06 07:06:08 2021 +0000
- Revision:
- 2:2a4f1bb68811
- Parent:
- 1:a79d2ebffe73
- Child:
- 3:bd632f30b46b
Za prvi test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tzwell | 0:cfac98129f2f | 1 | /* |
tzwell | 2:2a4f1bb68811 | 2 | * https://drive.google.com/drive/folders/1az2UIT1XcgSR50q0zc69UTegiXzlJ2Rb?usp=sharing |
tzwell | 0:cfac98129f2f | 3 | * Primer treperenja diode za STM32L476RG napisan |
tzwell | 0:cfac98129f2f | 4 | * koristeci mbed.h biblioteku. |
tzwell | 0:cfac98129f2f | 5 | * |
tzwell | 0:cfac98129f2f | 6 | * Katedra za Elektroniku i digitalne sisteme |
tzwell | 0:cfac98129f2f | 7 | * Elektrotehnicki fakultet |
tzwell | 0:cfac98129f2f | 8 | * Beograd |
tzwell | 0:cfac98129f2f | 9 | * |
tzwell | 0:cfac98129f2f | 10 | * Oktobar 2021. |
tzwell | 0:cfac98129f2f | 11 | * |
tzwell | 0:cfac98129f2f | 12 | */ |
tzwell | 0:cfac98129f2f | 13 | |
tzwell | 0:cfac98129f2f | 14 | /* |
tzwell | 0:cfac98129f2f | 15 | * Biblioteke za uvoz: |
tzwell | 0:cfac98129f2f | 16 | */ |
tzwell | 0:cfac98129f2f | 17 | #include "mbed.h" |
tzwell | 0:cfac98129f2f | 18 | |
tzwell | 0:cfac98129f2f | 19 | /* |
tzwell | 0:cfac98129f2f | 20 | * Definisanje makroa: |
tzwell | 0:cfac98129f2f | 21 | */ |
tzwell | 0:cfac98129f2f | 22 | #define HALF_PERIOD 250 |
tzwell | 0:cfac98129f2f | 23 | /* |
tzwell | 0:cfac98129f2f | 24 | * Globalne promenljive: |
tzwell | 0:cfac98129f2f | 25 | */ |
tzwell | 0:cfac98129f2f | 26 | |
tzwell | 0:cfac98129f2f | 27 | /* |
tzwell | 0:cfac98129f2f | 28 | * Deklaracija funkcija: |
tzwell | 0:cfac98129f2f | 29 | */ |
tzwell | 0:cfac98129f2f | 30 | |
tzwell | 0:cfac98129f2f | 31 | |
tzwell | 0:cfac98129f2f | 32 | /* |
tzwell | 0:cfac98129f2f | 33 | * Glavna funkcija: |
tzwell | 0:cfac98129f2f | 34 | */ |
tzwell | 0:cfac98129f2f | 35 | int main() |
tzwell | 0:cfac98129f2f | 36 | { |
tzwell | 1:a79d2ebffe73 | 37 | // Inicijalizacija i funckije koje se jednom izvrsavaju: |
tzwell | 0:cfac98129f2f | 38 | DigitalOut DiodicaNaPloci (LED1); // Kreiranje promenljive diode |
tzwell | 0:cfac98129f2f | 39 | |
tzwell | 0:cfac98129f2f | 40 | // Glavna petlja: |
tzwell | 0:cfac98129f2f | 41 | while(true) |
tzwell | 0:cfac98129f2f | 42 | { |
tzwell | 0:cfac98129f2f | 43 | DiodicaNaPloci = !DiodicaNaPloci; // Negacija prethodne vrednosti |
tzwell | 0:cfac98129f2f | 44 | wait_ms(HALF_PERIOD); // Cekanje |
tzwell | 0:cfac98129f2f | 45 | |
tzwell | 0:cfac98129f2f | 46 | } |
tzwell | 0:cfac98129f2f | 47 | } |
tzwell | 0:cfac98129f2f | 48 | |
tzwell | 0:cfac98129f2f | 49 | |
tzwell | 0:cfac98129f2f | 50 | /* |
tzwell | 0:cfac98129f2f | 51 | * Definicija funkcija: |
tzwell | 0:cfac98129f2f | 52 | */ |