You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Shows how to control RGB lighting of compatible peripheral devices."
17
+
---
18
+
19
+
<!---
20
+
category: DevicesSensorsAndPower
21
+
22
+
-->
23
+
24
+
# LampArray sample
25
+
26
+
This sample shows how to control RGB lighting of peripheral devices using the [Windows.Devices.Lights](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights) and [Windows.Devices.Lights.Effects](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights.effects) APIs.
27
+
28
+
Supported devices conform to the [HID Lighting and Illumination Standard](https://www.usb.org/sites/default/files/hutrr84_-_lighting_and_illumination_page.pdf).
29
+
30
+
Specifically, this sample shows how to:
31
+
32
+
- Use [Windows.Devices.Enumeration.DeviceWatcher](https://learn.microsoft.com/en-us/uwp/api/windows.devices.enumeration.devicewatcher) with an AQS filter to register for LampArray attach and removal events.
33
+
34
+
- Obtain instances of [Windows.Devices.Lights.LampArray](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights.lamparray) and use them to query device properties and change RGB lighting colors and brightness.
35
+
36
+
- Create compelling RGB lighting effects using the [Windows.Devices.Lights.Effects](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights.effects) APIs.
37
+
38
+
- Create an app package with the "com.microsoft.windows.lighting" AppExtension. The sample will assume control of lighting when in the foreground. Declaring the "com.microsoft.windows.lighting" AppExtension will allow the sample to appear in the Dynamic Lighting page of Windows Settings, where it can be prioritized for lighting control when not in the foreground (supported on Windows build 23466 and above).
39
+
40
+
**Note** The Windows universal samples require Visual Studio to build and Windows 10 to execute.
41
+
42
+
To obtain information about Windows 10 development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421).
43
+
44
+
To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422).
[HID Lighting and Illumination Standard](https://www.usb.org/sites/default/files/hutrr84_-_lighting_and_illumination_page.pdf)
57
+
58
+
[Dynamic Lighting](https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/lighting-dynamic-lamparray) - This page also describes how to declare the "com.microsoft.windows.lighting" AppExtension for background (ambient) lighting control.
59
+
60
+
[Dynamic lighting devices](https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/dynamic-lighting-devices) - This page contains a list of devices known to be compatible with the above HID Lighting standard.
61
+
62
+
## System requirements
63
+
64
+
**Client:** Windows 10, version 17763 or above.
65
+
66
+
**Server:** Not supported.
67
+
68
+
## Build the sample
69
+
70
+
1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
71
+
2. Start Microsoft Visual Studio and select **File**\>**Open**\>**Project/Solution**.
72
+
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++ or C#). Double-click the Visual Studio Solution (.sln) file.
73
+
4. Press Ctrl+Shift+B, or select **Build**\>**Build Solution**.
74
+
75
+
## Run the sample
76
+
77
+
The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it.
78
+
79
+
### Deploying the sample
80
+
81
+
- Select Build > Deploy Solution.
82
+
83
+
### Deploying and running the sample
84
+
85
+
- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging.
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
0 commit comments