34 int count()
const {
return _count; }
36 bool led(
int index)
const {
return _values[index] != 0; }
37 void setLed(
int index,
bool value) { _values[index] = (value ? 255 : 0); }
39 uint8_t
pwmLed(
int index)
const {
return _values[index]; }
40 void setPwmLed(
int index, uint8_t value) { _values[index] = value; }
42 unsigned long holdTime()
const {
return _holdTime; }
53 unsigned long _holdTime;
54 unsigned long _lastTime;
void setPwmLed(int index, uint8_t value)
Sets the PWM value of the LED at index in the charliplexed array; between 0 and 255.
~Charlieplex()
Destroys this charlieplexed array.
void setHoldTime(unsigned long us)
Sets the number of microseconds that each LED should be held on for before moving onto the next in lo...
Manage an array of LED's in a charlieplexed arrangement.
void setLed(int index, bool value)
Sets the value of the LED at index in the charliplexed array.
bool led(int index) const
Returns the value of the LED at index in the charplexed array; true if lit; false if not lit...
Charlieplex(const uint8_t *pins, uint8_t numPins)
Constructs a new charliexplexing array where the output pins are specified by the numPins entries in ...
void loop()
Runs the multiplexing loop, to display the LED states on the charlieplexed array. ...
int count() const
Returns the number of LED's in this charlieplexed array based on the number of pins.
unsigned long holdTime() const
Returns the number of microseconds that each LED should be held on for before moving onto the next in...
void refresh()
Refreshes the charlieplexed array by advancing to the next LED that needs to be lit.
uint8_t pwmLed(int index) const
Returns the PWM value of the LED at index in the charplexed array; between 0 and 255.