First version
Dependencies: mbed EthernetInterface mbed-rto
LEDDriver.h@9:c800045806f0, 2018-04-18 (annotated)
- Committer:
- albireo987
- Date:
- Wed Apr 18 10:06:48 2018 +0000
- Revision:
- 9:c800045806f0
- Parent:
- 8:a987e04734dd
- Child:
- 10:7871aeacea08
driver working delay needs finetuning;
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 "rtos.h" |
albireo987 | 6:36158325f7b0 | 5 | #include "copy.h" |
albireo987 | 6:36158325f7b0 | 6 | #include "mbed.h" |
albireo987 | 6:36158325f7b0 | 7 | |
albireo987 | 6:36158325f7b0 | 8 | class LEDDriver |
albireo987 | 6:36158325f7b0 | 9 | { |
albireo987 | 6:36158325f7b0 | 10 | private: |
albireo987 | 8:a987e04734dd | 11 | |
albireo987 | 9:c800045806f0 | 12 | int* messageList; |
albireo987 | 9:c800045806f0 | 13 | int* codedMessage0; |
albireo987 | 9:c800045806f0 | 14 | int* codedMessage1; |
albireo987 | 9:c800045806f0 | 15 | int* codedMessage2; |
albireo987 | 9:c800045806f0 | 16 | int* codedMessage3; |
albireo987 | 9:c800045806f0 | 17 | int directions[8]; |
albireo987 | 9:c800045806f0 | 18 | //Mutex* lock; |
albireo987 | 6:36158325f7b0 | 19 | Copy copy; |
albireo987 | 6:36158325f7b0 | 20 | DigitalOut* leds; |
albireo987 | 6:36158325f7b0 | 21 | |
albireo987 | 6:36158325f7b0 | 22 | int getDirection(int id); |
albireo987 | 6:36158325f7b0 | 23 | void encode(int direction,int led); |
albireo987 | 6:36158325f7b0 | 24 | void encodeAll(int numberOfLeds); |
albireo987 | 6:36158325f7b0 | 25 | |
albireo987 | 6:36158325f7b0 | 26 | public: |
albireo987 | 6:36158325f7b0 | 27 | |
albireo987 | 6:36158325f7b0 | 28 | void drive(int numberOfLeds); |
albireo987 | 6:36158325f7b0 | 29 | LEDDriver(/*Mutex* lock,*/ int sharedDirections[], int sizeOfSharedDirections); |
albireo987 | 6:36158325f7b0 | 30 | void run(int numberOfLeds); |
albireo987 | 6:36158325f7b0 | 31 | |
albireo987 | 6:36158325f7b0 | 32 | }; |
albireo987 | 6:36158325f7b0 | 33 | |
albireo987 | 6:36158325f7b0 | 34 | #endif |