Library for starting a fan

Dependents:   Kontrola_Temp

Files at this revision

API Documentation at this revision

Comitter:
tomislavs
Date:
Tue May 04 09:04:30 2021 +0000
Commit message:
Updated

Changed in this revision

ventilator.cpp Show annotated file Show diff for this revision Revisions of this file
ventilator.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ventilator.cpp	Tue May 04 09:04:30 2021 +0000
@@ -0,0 +1,13 @@
+#include "ventilator.h"
+#include "mbed.h"
+VENTILATOR::VENTILATOR(PinName pin) : _pin(pin)   //_pin(pin) znaci prosljedi pin na Digitalni izlaz konstruktora
+{
+    _pin = 0;
+}
+ 
+
+void VENTILATOR::stanje(int stanje)   //funkcija koja prima prijednost, te tu vrijednost postavlja na određeni pin
+{
+    _pin = stanje;
+}
+ 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ventilator.h	Tue May 04 09:04:30 2021 +0000
@@ -0,0 +1,13 @@
+#ifndef VENTILATOR_H   //ako VENTILATOR_H nije prijasno definiran
+#define VENTILATOR_H   //definiraj VENTILATOR_H sada
+#include "mbed.h"
+
+class VENTILATOR   //definiramo klasu VENTILATOR
+{
+public:
+    VENTILATOR(PinName pin);
+    void stanje(int stanje);   //pozivanje i slanje vrijednosti za funkciju stanje
+private:
+    DigitalOut _pin;   //definiramo _pin da bude digitalni izlaz
+};
+#endif   //završetak if-a
\ No newline at end of file