Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@1:a79d2ebffe73, 2021-10-28 (annotated)
- Committer:
- tzwell
- Date:
- Thu Oct 28 11:00:32 2021 +0000
- Revision:
- 1:a79d2ebffe73
- Parent:
- 0:cfac98129f2f
- Child:
- 2:2a4f1bb68811
Updated comments and code structure
Who changed what in which revision?
| User | Revision | Line number | New 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 | 1:a79d2ebffe73 | 36 | // Inicijalizacija i funckije koje se jednom 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 | */ |