![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
First version
Dependencies: mbed EthernetInterface mbed-rto
LEDDriver.h
- Committer:
- albireo987
- Date:
- 2018-04-15
- Revision:
- 8:a987e04734dd
- Parent:
- 6:36158325f7b0
- Child:
- 9:c800045806f0
File content as of revision 8:a987e04734dd:
#ifndef LEDDRIVER_H #define LEDDRIVER_H #include "rtos.h" #include "copy.h" #include "mbed.h" class LEDDriver { private: int** messageList; int* start; int* stop; int* directions; Mutex* lock; Copy copy; DigitalOut* leds; /** *method that returns the direction stored in the private direction array *@params the id of the led that you want the direction of *@return the direction for the specified led */ int getDirection(int id); /** *method that encodes the direction to the message for the specified led *@params the direction to encode into the message *@params the led you want to encode the message for */ void encode(int direction,int led); /** *method that encodes the messages for the specified number of leds *@params the number of leds to encode the message for */ void encodeAll(int numberOfLeds); public: /** *method to drive the leds *@params the number of leds */ void drive(int numberOfLeds); /** *method that copies the array for the specified records in another array *@params the array that has the shared array with directions *@params the number of directions */ LEDDriver(/*Mutex* lock,*/ int sharedDirections[], int sizeOfSharedDirections); /** *method that is prepared to run *@params the number of leds to run */ void run(int numberOfLeds); }; #endif