![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
First version
Dependencies: mbed EthernetInterface mbed-rto
LEDDriver.h@80:dbda5092950e, 2018-05-16 (annotated)
- Committer:
- albireo987
- Date:
- Wed May 16 11:15:25 2018 +0000
- Revision:
- 80:dbda5092950e
- Parent:
- 78:8efde3e9e3fb
commentaar geschreven def
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 | 78:8efde3e9e3fb | 10 | int mask; |
KlaasGovaerts | 47:8fe84f455571 | 11 | int messageList[8]; |
albireo987 | 78:8efde3e9e3fb | 12 | uint32_t codedMessage0; |
albireo987 | 78:8efde3e9e3fb | 13 | uint32_t codedMessage1; |
albireo987 | 78:8efde3e9e3fb | 14 | uint32_t codedMessage2; |
albireo987 | 78:8efde3e9e3fb | 15 | uint32_t codedMessage3; |
albireo987 | 78:8efde3e9e3fb | 16 | uint32_t codedMessage4; |
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 | 80:dbda5092950e | 21 | /** |
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 | /** |
albireo987 | 80:dbda5092950e | 28 | * Stel alle LEDS in voor een gegeven positie in het signaal. Voor juiste werking dien je de mask telkens te shiften. |
albireo987 | 80:dbda5092950e | 29 | *@param De positie in het signaal viqa de (kan gaan van 0 tot 24). |
KlaasGovaerts | 77:6477a4fefa70 | 30 | */ |
albireo987 | 80:dbda5092950e | 31 | void setLEDS(int mask); |
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 | /** |
albireo987 | 80:dbda5092950e | 57 | * Stelt de Arraymembers 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 |