API for controlling P9813/Chainable RGB LEDs.  
 More...
P9813 LED controller provides individually controllable LEDs through a two pin protocol For each LED, an RGB (0-255) value can be set.
     
    
    ledChain.setAllLeds(255, 0, 0);
    
    ledChain.setLed(1, 0, 255, 0);
 
 | 
|   | P9813 (uint16_t ledCount, uint16_t clkPin, uint16_t dataPin, bool batchMode=false) | 
|   | 
| virtual  | ~P9813 () | 
|   | 
| void  | setLed (uint16_t ledIdx, uint8_t r, uint8_t g, uint8_t b) | 
|   | 
| void  | setAllLeds (uint8_t r, uint8_t g, uint8_t b) | 
|   | 
| void  | setLeds (uint16_t startIdx, uint16_t endIdx, uint8_t r, uint8_t g, uint8_t b) | 
|   | 
| void  | setLeds (uint16_t startIdx, uint16_t endIdx, std::vector< RgbColor > colors) | 
|   | 
| void  | pushState () | 
|   | 
      
        
          | P9813  | 
          ( | 
          uint16_t  | 
          ledCount,  | 
        
        
           | 
           | 
          uint16_t  | 
          clkPin,  | 
        
        
           | 
           | 
          uint16_t  | 
          dataPin,  | 
        
        
           | 
           | 
          bool  | 
          batchMode = false  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Instantiates a new P9813 LED chain
- Parameters
 - 
  
    | ledCount | Number of P9813 leds in the chain  | 
    | clkPin | Clock Pin  | 
    | dataPin | Data Pin  | 
    | batchMode | (optional) Immediately write to the LED controllers (false, default) or wait for a pushState call (true)  | 
  
   
 
 
      
        
          | void setLed  | 
          ( | 
          uint16_t  | 
          ledIdx,  | 
        
        
           | 
           | 
          uint8_t  | 
          r,  | 
        
        
           | 
           | 
          uint8_t  | 
          g,  | 
        
        
           | 
           | 
          uint8_t  | 
          b  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Set the color for a single LED
- Parameters
 - 
  
    | ledIdx | Index of the LED in the chain (0 based)  | 
    | r | Red component (0-255)  | 
    | g | Green component (0-255)  | 
    | b | Blue component (0-255)  | 
  
   
 
 
      
        
          | void setAllLeds  | 
          ( | 
          uint8_t  | 
          r,  | 
        
        
           | 
           | 
          uint8_t  | 
          g,  | 
        
        
           | 
           | 
          uint8_t  | 
          b  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Set the color for all LEDs
- Parameters
 - 
  
    | r | Red component (0-255)  | 
    | g | Green component (0-255)  | 
    | b | Blue component (0-255)  | 
  
   
 
 
      
        
          | void setLeds  | 
          ( | 
          uint16_t  | 
          startIdx,  | 
        
        
           | 
           | 
          uint16_t  | 
          endIdx,  | 
        
        
           | 
           | 
          uint8_t  | 
          r,  | 
        
        
           | 
           | 
          uint8_t  | 
          g,  | 
        
        
           | 
           | 
          uint8_t  | 
          b  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Set the color for a range of LEDs
- Parameters
 - 
  
    | startIdx | Start index of the range of LEDs in the chain (0 based)  | 
    | endIdx | End index of the range of LEDs in the chain (0 based)  | 
    | r | Red component (0-255)  | 
    | g | Green component (0-255)  | 
    | b | Blue component (0-255)  | 
  
   
 
 
      
        
          | void setLeds  | 
          ( | 
          uint16_t  | 
          startIdx,  | 
        
        
           | 
           | 
          uint16_t  | 
          endIdx,  | 
        
        
           | 
           | 
          std::vector< RgbColor >  | 
          colors  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
(Advanced) Manually control the colors and brightness of a range of LEDS Best used to maximize performance
- Parameters
 - 
  
    | startIdx | Start index of the range of LEDs to update (0 based)  | 
    | endIdx | End index of the range of LEDs to update (0 based)  | 
    | colors | Vector containing RgbColor structures for each LED No check done on the boundaries  | 
  
   
 
 
Outputs the current LED data to the LED controllers Note: Only required if batch mode is set to TRUE 
 
 
The documentation for this class was generated from the following files: