Nikola Cvetković
/
19E042PIM_V2_Z1
Promena osvetljaja diode LED2 potenciometrom POT1
Revision 0:d859694d093c, committed 2021-11-11
- Comitter:
- tzwell
- Date:
- Thu Nov 11 19:04:21 2021 +0000
- Commit message:
- First publish first commit;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 11 19:04:21 2021 +0000 @@ -0,0 +1,53 @@ +/* + * Primer regulacije osvetljaja diode LED2 pomoću potenciometra POT1 + * pisan za STM32L476RG napisan koristeci mbed.h biblioteku. + * + * Katedra za Elektroniku i digitalne sisteme + * Elektrotehnicki fakultet + * Beograd + * + * Novembar 2021. + * + */ + +/* + * Biblioteke za uvoz: + */ +#include "mbed.h" + +/* + * Definisanje makroa: + */ +#define INCREMENT 0.1f +/* + * Globalne promenljive: + */ +PwmOut blue_led(PB_15); // Kreiranje promenljive diode +AnalogIn potentiometer(PA_0); // Kreiranje promenljive potenciometra POT1 + +/* + * Deklaracija funkcija: + */ + + +/* + * Glavna funkcija: + */ +int main() +{ + + // Inicijalizacija i funckije koje se jednom izvrsavaju: + + // Glavna petlja: + while(true) + { + blue_led.write(potentiometer.read()); + //ili: + // blue_led = potentiometer; + } +} + + +/* + * Definicija funkcija: + */ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 11 19:04:21 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file