WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController Class Reference

The TeensyStripController is used to control up to 8 WS2811/WS2812 based ledstrips with up to 1100 leds per strip which are connected to a Teensy 3.1, 3.2 or later. More...

Inheritance diagram for DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController:
DirectOutput.Cab.Out.OutputControllerCompleteBase DirectOutput.General.Generic.NamedItemBase DirectOutput.Cab.Out.IOutputController DirectOutput.Cab.Out.ISupportsSetValues DirectOutput.General.Generic.INamedItem DirectOutput.General.Generic.INamedItem DirectOutput.Cab.Out.IOutputController DirectOutput.General.Generic.INamedItem

Protected Member Functions

override int GetNumberOfConfiguredOutputs ()
 This method returns the sum of the number of leds configured for the 8 output channels of the Teensy board. More...
 
override bool VerifySettings ()
 Verifies if a valid ComPortName has been set and if the number of outputs per channel is >=0. More...
 
override void UpdateOutputs (byte[] OutputValues)
 This method is called whenever new data has to be sent to the output controller. Implement the communication with your hereware in this method. More...
 
override void ConnectToController ()
 This method is called when DOF wants to connect to the controller. More...
 
override void DisconnectFromController ()
 Disconnects from the controller. More...
 
- Protected Member Functions inherited from DirectOutput.Cab.Out.OutputControllerCompleteBase
void SetupOutputs ()
 Manages to output object of the output controller. Use the GetNumberOfConfiguredOutputs() method to determine the number of outputs to be setup. More...
 
override void AfterNameChange (string OldName, string NewName)
 
- Protected Member Functions inherited from DirectOutput.General.Generic.NamedItemBase
virtual void BeforeNameChange (string OldName, string NewName)
 
virtual void OnPropertyChanged (string propertyName)
 
virtual void OnPropertyChanging (string propertyName)
 

Properties

int NumberOfLedsStrip1 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 1 of the Teensy. More...
 
int NumberOfLedsStrip2 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 2 of the Teensy. More...
 
int NumberOfLedsStrip3 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 3 of the Teensy. More...
 
int NumberOfLedsStrip4 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 4 of the Teensy. More...
 
int NumberOfLedsStrip5 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 5 of the Teensy. More...
 
int NumberOfLedsStrip6 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 6 of the Teensy. More...
 
int NumberOfLedsStrip7 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 7 of the Teensy. More...
 
int NumberOfLedsStrip8 [get, set]
 Gets or sets the number of leds of ledstrip connected to channel 8 of the Teensy. More...
 
string ComPortName [get, set]
 Gets or sets the name (typicaly COM{Number}) of the virtual Com port the Teensy board is using. More...
 
int ComPortTimeOutMs [get, set]
 Gets or sets the COM port timeout in milliseconds. This properties accepts values between 1 and 5000 milliseconds (default 200ms). If a value outside this range is specified, the properties value reverts to the default value of 200ms. More...
 
- Properties inherited from DirectOutput.Cab.Out.OutputControllerCompleteBase
OutputList Outputs [get, set]
 Contains the OutputList object for the outputs of the output controller.
More...
 
bool UpdaterThreadIsActive [get]
 Indicates whether the UpdaterThread is active or not. More...
 
- Properties inherited from DirectOutput.General.Generic.NamedItemBase
string Name [get, set]
 Name of the named item.
Triggers BeforeNameChange before a new Name is set.
Triggers AfterNameChanged after a new name has been set. More...
 
- Properties inherited from DirectOutput.General.Generic.INamedItem
string Name [get, set]
 Gets or sets the name of the item.
Must fire the BeforeNameChange and AfterNameChange events when the value of the property is changed. More...
 
- Properties inherited from DirectOutput.Cab.Out.IOutputController
new string Name [get, set]
 Name of the IOutputController. This property is fully implemented in the abstract OutputControllerBase class. More...
 
OutputList Outputs [get, set]
 OutputList containing the IOutput objects for a IOutputController. More...
 

Additional Inherited Members

- Public Member Functions inherited from DirectOutput.Cab.Out.OutputControllerCompleteBase
void SetValues (int FirstOutput, byte[] Values)
 Sets the values for one or several outputs of the controller. More...
 
virtual void Init (Cabinet Cabinet)
 Initializes the output controller and starts the updater thread. More...
 
virtual void Finish ()
 Finishes the output controller and stop the updater thread. More...
 
void Update ()
 Triggers the update of the physical outputs More...
 
- Events inherited from DirectOutput.General.Generic.NamedItemBase
EventHandler< NameChangeEventArgsAfterNameChanged
 Event is fired after the value of the property Name has changed. More...
 
EventHandler< NameChangeEventArgsBeforeNameChanged
 Event is fired before the value of the property Name is changed. More...
 
PropertyChangedEventHandler PropertyChanged
 
PropertyChangingEventHandler PropertyChanging
 
- Events inherited from DirectOutput.General.Generic.INamedItem
EventHandler< NameChangeEventArgsBeforeNameChanged
 Occurs before the name of the item changes. More...
 
EventHandler< NameChangeEventArgsAfterNameChanged
 Occurs when after the name of the item has changed. More...
 

Detailed Description

The TeensyStripController is used to control up to 8 WS2811/WS2812 based ledstrips with up to 1100 leds per strip which are connected to a Teensy 3.1, 3.2 or later.

TeensyOctoWS2811.jpg

The best place to get the hardware is probably the website of the Teennsy inventor, where you can buy the Teensy boards (check if newer versions are available) and also a adapter board which allows for easy connection of up to 8 led strips. There are also numerous other vendors of Teensy hardware (just ask Google).

The firmware for the Teensy based ledstrip controller is based on a slightly hacked version of Paul Stoffregens excellent OctoWS2811 LED Library which can easily drive up to 1100leds per channel on a Teensy 3.1 or later. More information on the OctoWS2811 lib can be found on the Teensy website, on Github and many other places on the internet.

Ready to use, compiled firmware files can be downloaded from the Github page for the TeensyStripController, the source code for the firmware is available on Github as well.

Definition at line 22 of file TeensyStripController.cs.

Member Function Documentation

override void DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.ConnectToController ( )
protectedvirtual

This method is called when DOF wants to connect to the controller.

Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.

Definition at line 362 of file TeensyStripController.cs.

override void DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.DisconnectFromController ( )
protectedvirtual

Disconnects from the controller.

Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.

Definition at line 542 of file TeensyStripController.cs.

override int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.GetNumberOfConfiguredOutputs ( )
protectedvirtual

This method returns the sum of the number of leds configured for the 8 output channels of the Teensy board.

Returns
The sum of the number of leds configured for the 8 output channels of the Teensy board.

Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.

Definition at line 222 of file TeensyStripController.cs.

override void DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.UpdateOutputs ( byte[]  OutputValues)
protectedvirtual

This method is called whenever new data has to be sent to the output controller. Implement the communication with your hereware in this method.

Parameters
OutputValuesArray of output values for each numbered output.

Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.

Definition at line 259 of file TeensyStripController.cs.

override bool DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.VerifySettings ( )
protectedvirtual

Verifies if a valid ComPortName has been set and if the number of outputs per channel is >=0.

Returns
true if the verification is OK, otherwise false

Implements DirectOutput.Cab.Out.OutputControllerCompleteBase.

Definition at line 233 of file TeensyStripController.cs.

Property Documentation

string DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.ComPortName
getset

Gets or sets the name (typicaly COM{Number}) of the virtual Com port the Teensy board is using.

The name of the Com port (typicaly COM{Number}) the Teensy board is using.

Definition at line 182 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.ComPortTimeOutMs
getset

Gets or sets the COM port timeout in milliseconds. This properties accepts values between 1 and 5000 milliseconds (default 200ms). If a value outside this range is specified, the properties value reverts to the default value of 200ms.

The COM port timeout in milliseconds (Valid range 1-5000ms, default: 200ms).

Definition at line 198 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip1
getset

Gets or sets the number of leds of ledstrip connected to channel 1 of the Teensy.

The number of leds on the ledstrip connected to channel 1 of the Teensy.

Definition at line 33 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip2
getset

Gets or sets the number of leds of ledstrip connected to channel 2 of the Teensy.

The number of leds on the ledstrip connected to channel 2 of the Teensy.

Definition at line 51 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip3
getset

Gets or sets the number of leds of ledstrip connected to channel 3 of the Teensy.

The number of leds on the ledstrip connected to channel 3 of the Teensy.

Definition at line 70 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip4
getset

Gets or sets the number of leds of ledstrip connected to channel 4 of the Teensy.

The number of leds on the ledstrip connected to channel 4 of the Teensy.

Definition at line 88 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip5
getset

Gets or sets the number of leds of ledstrip connected to channel 5 of the Teensy.

The number of leds on the ledstrip connected to channel 5 of the Teensy.

Definition at line 106 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip6
getset

Gets or sets the number of leds of ledstrip connected to channel 6 of the Teensy.

The number of leds on the ledstrip connected to channel 6 of the Teensy.

Definition at line 125 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip7
getset

Gets or sets the number of leds of ledstrip connected to channel 7 of the Teensy.

The number of leds on the ledstrip connected to channel 7 of the Teensy.

Definition at line 143 of file TeensyStripController.cs.

int DirectOutput.Cab.Out.AdressableLedStrip.TeensyStripController.NumberOfLedsStrip8
getset

Gets or sets the number of leds of ledstrip connected to channel 8 of the Teensy.

The number of leds on the ledstrip connected to channel 8 of the Teensy.

Definition at line 161 of file TeensyStripController.cs.


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