Parking senzor izveden s NUCLEO F411RE mikroupravljačem te HCSR04 ultrazvučnim senzorom i piezo električnim zvučnikom

Dependents:   TVZ_MU2020_Parkingsenzor_DanijelPranjic Parking_senzor_Danijel_Pranjic

https://os.mbed.com/media/uploads/danijel28/zvucniefekt.h https://os.mbed.com/media/uploads/danijel28/zvucniefekt.cpp https://os.mbed.com/media/uploads/danijel28/indikatorudaljenostiobjekta.h https://os.mbed.com/media/uploads/danijel28/indikatorudaljenostiobjekta.cpp https://os.mbed.com/media/uploads/danijel28/hcsr04.h https://os.mbed.com/media/uploads/danijel28/hcsr04.cpp https://os.mbed.com/media/uploads/danijel28/mbed_config.h https://os.mbed.com/media/uploads/danijel28/deklaracijavarijabli.h https://os.mbed.com/media/uploads/danijel28/main.cpp

Files at this revision

API Documentation at this revision

Comitter:
danijel28
Date:
Tue Feb 04 17:57:53 2020 +0000
Commit message:
I created class Tipkalo for my hardware interupt

Changed in this revision

Tipkalo.cpp Show annotated file Show diff for this revision Revisions of this file
Tipkalo.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 606302459409 Tipkalo.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tipkalo.cpp	Tue Feb 04 17:57:53 2020 +0000
@@ -0,0 +1,16 @@
+#include "Tipkalo.h"
+#include "mbed.h"
+Tipkalo::Tipkalo(PinName pin) : prekidac(pin)
+{
+    prekidac.rise(this,&Tipkalo::povecajKodPritiskaGumba);
+}
+
+void Tipkalo::povecajKodPritiskaGumba()
+{
+    brojac++;
+}
+
+int Tipkalo::procitajBrojPritisakaGumba()
+{
+    return brojac;
+}
\ No newline at end of file
diff -r 000000000000 -r 606302459409 Tipkalo.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tipkalo.h	Tue Feb 04 17:57:53 2020 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#ifndef Tipkalo_H
+#define Tipkalo_H
+
+class Tipkalo
+{
+public:
+    int brojac;
+    Tipkalo(PinName pin);
+    void povecajKodPritiskaGumba();
+    int procitajBrojPritisakaGumba();
+
+private:
+    InterruptIn prekidac;
+    Timer debounce;
+};
+#endif