Treehopper C# API
Apa102 Class Reference

Shiji Lighting Co. More...

Inheritance diagram for Apa102:
IFlushable

Classes

class  Led
 Represents a single APA102 LED's value More...
 

Public Member Functions

 Apa102 (Spi spi, int numLeds, double frequency=6)
 Construct a new chain of APA102-based smart LEDs. More...
 
async Task FlushAsync (bool force=false)
 Flush current LED values to the SPI bus to update the LEDs. More...
 
async Task Clear ()
 Clear the display immediately, resetting all LEDs' values. More...
 

Public Attributes

IFlushable Parent => null
 The parent Flushable interface. More...
 

Properties

IList< LedLeds = new List<Led>() [get]
 Gets the LEDs belonging to this APA102 instance. More...
 
double Brightness = 1.0 [get, set]
 Gets or sets the global brightness of the LED strip More...
 
bool AutoFlush = true [get, set]
 Whether this strip of LEDs should be updated immediately, or only when FlushAsync(bool) is called. More...
 

Detailed Description

Shiji Lighting Co.

iPixel APA102 (DotStar) Smart RGB LED

The APA102

Constructor & Destructor Documentation

◆ Apa102()

Apa102 ( Spi  spi,
int  numLeds,
double  frequency = 6 
)

Construct a new chain of APA102-based smart LEDs.

Parameters
spiThe SPI port to use
numLedsThe number of APA102 smart LEDs in this chain
frequencyThe frequency to use

Member Function Documentation

◆ FlushAsync()

async Task FlushAsync ( bool  force = false)

Flush current LED values to the SPI bus to update the LEDs.

Parameters
forceUnused for this method
Returns
An awaitable task

Implements IFlushable.

◆ Clear()

async Task Clear ( )

Clear the display immediately, resetting all LEDs' values.

Returns
An awaitable task

Member Data Documentation

◆ Parent

IFlushable Parent => null

The parent Flushable interface.

Property Documentation

◆ Leds

IList<Led> Leds = new List<Led>()
get

Gets the LEDs belonging to this APA102 instance.

◆ Brightness

double Brightness = 1.0
getset

Gets or sets the global brightness of the LED strip

◆ AutoFlush

bool AutoFlush = true
getset

Whether this strip of LEDs should be updated immediately, or only when FlushAsync(bool) is called.


The documentation for this class was generated from the following file: