Promena osvetljaja diode LED2 potenciometrom POT1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

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
diff -r 000000000000 -r d859694d093c main.cpp
--- /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
diff -r 000000000000 -r d859694d093c mbed.bld
--- /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