![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
First version
Dependencies: mbed EthernetInterface mbed-rto
LEDDriver.h@77:6477a4fefa70, 2018-05-15 (annotated)
- Committer:
- KlaasGovaerts
- Date:
- Tue May 15 22:31:05 2018 +0000
- Revision:
- 77:6477a4fefa70
- Parent:
- 70:939f51a1a223
- Child:
- 78:8efde3e9e3fb
Nog extra commentaar.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
albireo987 | 6:36158325f7b0 | 1 | #ifndef LEDDRIVER_H |
albireo987 | 6:36158325f7b0 | 2 | #define LEDDRIVER_H |
albireo987 | 6:36158325f7b0 | 3 | |
albireo987 | 6:36158325f7b0 | 4 | #include "mbed.h" |
albireo987 | 26:4c673da1a3ae | 5 | #include "rtos.h" |
albireo987 | 6:36158325f7b0 | 6 | |
albireo987 | 6:36158325f7b0 | 7 | class LEDDriver |
albireo987 | 6:36158325f7b0 | 8 | { |
albireo987 | 6:36158325f7b0 | 9 | private: |
albireo987 | 8:a987e04734dd | 10 | |
KlaasGovaerts | 47:8fe84f455571 | 11 | int messageList[8]; |
KlaasGovaerts | 54:4274186bf584 | 12 | int codedMessage0[25]; |
KlaasGovaerts | 54:4274186bf584 | 13 | int codedMessage1[25]; |
KlaasGovaerts | 54:4274186bf584 | 14 | int codedMessage2[25]; |
KlaasGovaerts | 54:4274186bf584 | 15 | int codedMessage3[25]; |
KlaasGovaerts | 54:4274186bf584 | 16 | int codedMessage4[25]; |
albireo987 | 26:4c673da1a3ae | 17 | Queue<int,8>* queue; |
KlaasGovaerts | 48:c5cd73d93045 | 18 | DigitalOut *leds[8]; |
KlaasGovaerts | 45:2d877f01ca7b | 19 | int currentLocation; |
albireo987 | 6:36158325f7b0 | 20 | |
albireo987 | 26:4c673da1a3ae | 21 | /**prep for eventual multithreading |
albireo987 | 26:4c673da1a3ae | 22 | *methode om nieuwe richtingen van de receiver klasse te ontvangen |
albireo987 | 26:4c673da1a3ae | 23 | *@params aantal leds die een nieuw bericht moeten krijgen |
albireo987 | 26:4c673da1a3ae | 24 | */ |
KlaasGovaerts | 55:4e06cfb6d010 | 25 | void poll(int numberOfLeds); |
albireo987 | 38:47c075a354b5 | 26 | |
KlaasGovaerts | 77:6477a4fefa70 | 27 | /** |
KlaasGovaerts | 77:6477a4fefa70 | 28 | * Stel alle LEDS in voor een gegeven positie in het signaal. Voor juiste werking dien je de positie telkens te incrementeren vanaf 0 t.e.m. 24. |
KlaasGovaerts | 77:6477a4fefa70 | 29 | *@param j De positie in het signaal (kan gaan van 0 tot 24). |
KlaasGovaerts | 77:6477a4fefa70 | 30 | */ |
KlaasGovaerts | 45:2d877f01ca7b | 31 | void setLEDS(int j); |
KlaasGovaerts | 45:2d877f01ca7b | 32 | |
albireo987 | 10:7871aeacea08 | 33 | public: |
KlaasGovaerts | 55:4e06cfb6d010 | 34 | |
albireo987 | 10:7871aeacea08 | 35 | /** |
albireo987 | 10:7871aeacea08 | 36 | *methode dat alle leds aanstuurt |
albireo987 | 10:7871aeacea08 | 37 | *@params aantal leds aan te sturen |
albireo987 | 10:7871aeacea08 | 38 | */ |
albireo987 | 6:36158325f7b0 | 39 | void drive(int numberOfLeds); |
albireo987 | 10:7871aeacea08 | 40 | |
albireo987 | 10:7871aeacea08 | 41 | /** |
albireo987 | 10:7871aeacea08 | 42 | *constructor voor een driver object |
albireo987 | 32:537005b4a065 | 43 | *@params de queue met de waarden die een richting aanduiden |
albireo987 | 10:7871aeacea08 | 44 | */ |
albireo987 | 26:4c673da1a3ae | 45 | LEDDriver(Queue<int,8>* queue); |
albireo987 | 70:939f51a1a223 | 46 | /* |
albireo987 | 70:939f51a1a223 | 47 | *Destructor |
albireo987 | 70:939f51a1a223 | 48 | */ |
KlaasGovaerts | 58:738f026cf667 | 49 | ~LEDDriver(); |
KlaasGovaerts | 58:738f026cf667 | 50 | |
KlaasGovaerts | 77:6477a4fefa70 | 51 | /** |
KlaasGovaerts | 77:6477a4fefa70 | 52 | * Functie die 8 leds aanstuurt. |
KlaasGovaerts | 77:6477a4fefa70 | 53 | */ |
KlaasGovaerts | 44:ffac07bff0d8 | 54 | void drive8leds(); |
KlaasGovaerts | 77:6477a4fefa70 | 55 | |
KlaasGovaerts | 77:6477a4fefa70 | 56 | /** |
KlaasGovaerts | 77:6477a4fefa70 | 57 | * Stelt de members in op hun default waarde. |
KlaasGovaerts | 77:6477a4fefa70 | 58 | */ |
KlaasGovaerts | 45:2d877f01ca7b | 59 | void initArrays(); |
KlaasGovaerts | 45:2d877f01ca7b | 60 | }; |
albireo987 | 6:36158325f7b0 | 61 | |
albireo987 | 6:36158325f7b0 | 62 | #endif |