![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
demo versie 16/05
Dependencies: EthernetInterface mbed-rto mbed
Fork of ProjectVLC by
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 | 2:36158325f7b0 | 1 | #ifndef LEDDRIVER_H |
albireo987 | 2:36158325f7b0 | 2 | #define LEDDRIVER_H |
albireo987 | 2:36158325f7b0 | 3 | |
albireo987 | 2:36158325f7b0 | 4 | #include "mbed.h" |
albireo987 | 25:4c673da1a3ae | 5 | #include "rtos.h" |
albireo987 | 2:36158325f7b0 | 6 | |
albireo987 | 2:36158325f7b0 | 7 | class LEDDriver |
albireo987 | 2:36158325f7b0 | 8 | { |
albireo987 | 2:36158325f7b0 | 9 | private: |
albireo987 | 78:8efde3e9e3fb | 10 | int mask; |
KlaasGovaerts | 49: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 | 25:4c673da1a3ae | 17 | Queue<int,8>* queue; |
KlaasGovaerts | 50:c5cd73d93045 | 18 | DigitalOut *leds[8]; |
KlaasGovaerts | 47:2d877f01ca7b | 19 | int currentLocation; |
albireo987 | 2:36158325f7b0 | 20 | |
albireo987 | 80:dbda5092950e | 21 | /** |
albireo987 | 25:4c673da1a3ae | 22 | *methode om nieuwe richtingen van de receiver klasse te ontvangen |
albireo987 | 25:4c673da1a3ae | 23 | *@params aantal leds die een nieuw bericht moeten krijgen |
albireo987 | 25:4c673da1a3ae | 24 | */ |
KlaasGovaerts | 58: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 | 47:2d877f01ca7b | 32 | |
albireo987 | 10:7871aeacea08 | 33 | public: |
KlaasGovaerts | 58: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 | 2: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 | 25:4c673da1a3ae | 45 | LEDDriver(Queue<int,8>* queue); |
albireo987 | 70:939f51a1a223 | 46 | /* |
albireo987 | 70:939f51a1a223 | 47 | *Destructor |
albireo987 | 70:939f51a1a223 | 48 | */ |
KlaasGovaerts | 61:738f026cf667 | 49 | ~LEDDriver(); |
KlaasGovaerts | 61:738f026cf667 | 50 | |
KlaasGovaerts | 77:6477a4fefa70 | 51 | /** |
KlaasGovaerts | 77:6477a4fefa70 | 52 | * Functie die 8 leds aanstuurt. |
KlaasGovaerts | 77:6477a4fefa70 | 53 | */ |
KlaasGovaerts | 46: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 | 47:2d877f01ca7b | 59 | void initArrays(); |
KlaasGovaerts | 47:2d877f01ca7b | 60 | }; |
albireo987 | 2:36158325f7b0 | 61 | |
albireo987 | 2:36158325f7b0 | 62 | #endif |