Exemple #1
0
        /// <inheritdoc />
        public IEnumerable <IRGBDevice> CreateDevices(IDeviceUpdateTrigger updateTrigger)
        {
            BitwizardWS2812USBUpdateQueue queue = new BitwizardWS2812USBUpdateQueue(updateTrigger, SerialConnection);
            string name = Name ?? $"Bitwizard WS2812 USB ({Port})";
            BitwizardWS2812USBDevice device = new BitwizardWS2812USBDevice(new BitwizardWS2812USBDeviceInfo(name), queue);

            device.Initialize(StripLength);
            yield return(device);
        }
Exemple #2
0
        /// <inheritdoc />
        public IEnumerable <IRGBDevice> CreateDevices()
        {
            DeviceUpdateTrigger updateTrigger = new DeviceUpdateTrigger();

            BitwizardWS2812USBUpdateQueue queue = new BitwizardWS2812USBUpdateQueue(updateTrigger, Port, BaudRate);
            string name = Name ?? $"Bitwizard WS2812 USB ({Port})";
            BitwizardWS2812USBDevice device = new BitwizardWS2812USBDevice(new BitwizardWS2812USBDeviceInfo(name), queue);

            device.Initialize(StripLength);
            yield return(device);

            updateTrigger.Start();
        }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BitwizardWS2812USBDevice"/> class.
 /// </summary>
 /// <param name="deviceInfo">The update trigger used by this queue.</param>
 /// <param name="updateQueue">The update queue performing updates for this device.</param>
 public BitwizardWS2812USBDevice(BitwizardWS2812USBDeviceInfo deviceInfo, BitwizardWS2812USBUpdateQueue updateQueue)
 {
     this.DeviceInfo  = deviceInfo;
     this.UpdateQueue = updateQueue;
 }