// The triple-slash "///" comments shown will be used in the build process to create an XML file named // GTM.DevhammerEnterprises.StarBoard. This file will provide IntelliSense and documentation for the // interface and make it easier for developers to use the StarBoard module. // Note: A constructor summary is auto-generated by the doc builder. /// <summary></summary> /// <param name="socketNumber">The socket that this module is plugged in to.</param> public StarBoard(int socketNumber) { // This finds the Socket instance from the user-specified socket number. // This will generate user-friendly error messages if the socket is invalid. // If there is more than one socket on this module, then instead of "null" for the last parameter, // put text that identifies the socket to the user (e.g. "S" if there is a socket type S) socket = Socket.GetSocket(socketNumber, true, this, "S"); socket.EnsureTypeIsSupported('S', this); int NumberOfLeds = 13; // Initialize the strip : the SPI_Module of the current socket and 800Khz model and using the linear human perceived luminosity PWM conversion factor of 2.25 MyWS2811Strip = new WS2811Led(NumberOfLeds, socket.SPIModule, WS2811Led.WS2811Speed.S800KHZ, 2.25); }
public StarLEDs() { int NumberOfLeds = 13; // Modify here the led number of your strip ! // Initialize the strip : here using SPI2 and 800Khz model and using the linear human perceived luminosity PWM conversion factor of 2.25 MyWS2811Strip = new WS2811Led(NumberOfLeds, SPI.SPI_module.SPI1, WS2811Led.WS2811Speed.S800KHZ, 2.25); //byte[] buff = new byte[] { 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 255 }; //MyWS2811Strip.SetRange(buff, 0, 13); //MyWS2811Strip.Transmit(); //ringsSolid(); //rotateLines(); //rings(1); }
// This method is run when the mainboard is powered up or reset. void ProgramStarted() { // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging. Debug.Print("Program Started"); _colorPin0 = colorSelector.CreateDigitalInput(GT.Socket.Pin.Three, GlitchFilterMode.Off, ResistorMode.PullDown); _colorPin1 = colorSelector.CreateDigitalInput(GT.Socket.Pin.Four, GlitchFilterMode.Off, ResistorMode.PullDown); _colorPin2 = colorSelector.CreateDigitalInput(GT.Socket.Pin.Five, GlitchFilterMode.Off, ResistorMode.PullDown); _colorPin3 = colorSelector.CreateDigitalInput(GT.Socket.Pin.Six, GlitchFilterMode.Off, ResistorMode.PullDown); // Setup the strip. I'm using a Cerb so must use SPI1 _ws2812Strip = new WS2811Led(_numberOfLeds, SPI.SPI_module.SPI1, WS2811Led.WS2811Speed.S800KHZ, 2.25); // Setup a new thread to drive the NeoPixels var driveThread = new Thread(DriveStrip); // Start the thread driveThread.Start(); // Wait forever Thread.Sleep(Timeout.Infinite); }