Tim Meijer
/
RTS
Voor Jeroen
Revision 1:615583651887, committed 2015-12-11
- Comitter:
- tim2meijer
- Date:
- Fri Dec 11 09:24:48 2015 +0000
- Parent:
- 0:68a09c7e27f0
- Commit message:
- VOOR JEROEN
Changed in this revision
diff -r 68a09c7e27f0 -r 615583651887 IO.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IO.h Fri Dec 11 09:24:48 2015 +0000 @@ -0,0 +1,10 @@ +#ifndef IO_H +#define IO_H + +DigitalOut led(LED1); +DigitalIn kop1(p20); +InterruptIn aanuit(p19); +DigitalIn kop2(p18); +InterruptIn resevoir(p17); + +#endif \ No newline at end of file
diff -r 68a09c7e27f0 -r 615583651887 klassen.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/klassen.cpp Fri Dec 11 09:24:48 2015 +0000 @@ -0,0 +1,29 @@ +#include "klassen.h" + +Pomp::Pomp() { +} + +Waterresevoir::Waterresevoir(double mondergrens_1kop, double mondergrens_2kop) { + ondergrens_1kop = mondergrens_1kop; + ondergrens_2kop = mondergrens_2kop; +} + +Besturingspaneel::Besturingspaneel(double mledfrequentieSnel, double mledfrequentieNormaal, int maantal_koppen, Waterresevoir mwaterresevoir, Pomp mpomp) { + ledfrequentieSnel = mledfrequentieSnel; + ledfrequentieNormaal = mledfrequentieNormaal; + aantal_koppen = maantal_koppen; + waterresevoir = mwaterresevoir; + pomp = mpomp; +} + +void Besturingspaneel::ledlamp(double mledfrequentie) { + +} + +void Besturingspaneel::set_1kop() { + aantal_koppen = 1; +} + + void Besturingspaneel::set_2kop() { + aantal_koppen = 2; +} \ No newline at end of file
diff -r 68a09c7e27f0 -r 615583651887 klassen.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/klassen.h Fri Dec 11 09:24:48 2015 +0000 @@ -0,0 +1,37 @@ +#ifndef KLASSEN_H +#define KLASSEN_H + +class Pomp { + private: + public: + Pomp(); + void Pompen(int maantal_koppen); + bool koffie_klaar(); +}; + +class Waterresevoir { + private: + double ondergrens_1kop; + double ondergrens_2kop; + public: + Waterresevoir(double mondergrens_1kop = 0.0, double mondergrens_2kop = 0.0); + bool water_ok(); + bool resevoir_geplaatst(); +}; + +class Besturingspaneel { + protected: + double ledfrequentieSnel; + double ledfrequentieNormaal; + int aantal_koppen; + Waterresevoir waterresevoir; + Pomp pomp; + public: + Besturingspaneel(double mledfrequentieSnel, double mledfrequentieNormaal, int maantal_koppen, Waterresevoir mwaterresevoir, Pomp mpomp); + void ledlamp(double mledfrequentie); + void set_senseo_aan(); + void set_1kop(); + void set_2kop(); +}; + +#endif \ No newline at end of file
diff -r 68a09c7e27f0 -r 615583651887 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Dec 11 09:24:48 2015 +0000 @@ -0,0 +1,15 @@ +#include "mbed.h" +//#include "rtos.h" +//#include "klassen.h" +#include "IO.h" + +int main() { + //Pomp pomp1(); + //Waterresevoir waterresevoir1(10, 20); + for(int i = 0; i < 20; i++) { + led = !led; + wait(1.0); + } + //Besturingspaneel besturingspaneel1(0.25, 0.75, 1, waterresevoir1, pomp1); +} +
diff -r 68a09c7e27f0 -r 615583651887 opdracht1.cpp --- a/opdracht1.cpp Fri Nov 27 07:54:00 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -#include "mbed.h" -#include "rtos.h" - -DigitalOut led(LED1); -DigitalIn push(p5); - -void toggleLedTask(void const *argument) { - while(true) { - if(push) led = 1; - else led = 0; - } -} - -int main() -{ - Thread tread1(toggleLedTask); - - while(true) { - } -} \ No newline at end of file
diff -r 68a09c7e27f0 -r 615583651887 opdracht2.cpp --- a/opdracht2.cpp Fri Nov 27 07:54:00 2015 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -#include "mbed.h" -#include "rtos.h" - -DigitalOut led(LED1); -InterruptIn push(p5); - -Thread* pointer; - -void interrupthandler() -{ - pointer->signal_set(0x1); -} - -void toggleLedTask(void const *argument) -{ - while(true) { - Thread::signal_wait(0x1); - led != led; - } -} - -int main() -{ - Thread thread1(toggleLedTask); - pointer = &thread1; - push.rise(&interrupthandler); - - while(true) { - } -} \ No newline at end of file