New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick start guide? #2

Closed
BrianLima opened this Issue Oct 16, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@BrianLima
Copy link

BrianLima commented Oct 16, 2017

Hi, could you provide a quick start guide? I don't need a full blown tutorial, but a small explanation about the things it would help me very much.

@DarthAffe

This comment has been minimized.

Copy link
Owner

DarthAffe commented Oct 17, 2017

Hey, first of all I'd like to make sure, that you're aware that this library is still in heavy development (even if it doesn't seem so - I'm a bit short on time lately) and will definitely have breaking api-changes in the near future.


Settings things up to use it right now is a bit tricky. I think the best way is the following:

  1. Clone and build the solution.
  2. Run the pack_all.bat in the NuGet directory
  3. Add the NuGet-directory as a local nuget-repository (you can do that by adding a nuget.config to the solution directory of the solution you want to use it in https://gist.github.com/DarthAffe/c2f3cfa7af30e4d94025ac314e029b40)
  4. Install the packages you want to use (You need core and the device-packages for all devices you want to use, I recommend the brushes, groups and decorators package - but that depends on what you want to do).

If this is done using the library is quite simple:
The first thing you need is the surface. You can get it from the static property RGBSurface.Instance.
You can configure how the library updates the devices but I'd recommend to only change the UpdateMode to Continuous and leave everything as is, as long as you don't have any problems with how it works by default.
You'll need to load your devices once (application start or something similar) by calling LoadDevices in the surface.
It doesn't matter if a device of a provider is connected so I personally just call everything like this:

RGBSurface surface = RGBSurface.Instance;
surface.Exception += args => Debug.WriteLine(args.Exception.Message));

surface.LoadDevices(AuraDeviceProvider.Instance); // This one can cause some trouble right now
surface.LoadDevices(CorsairDeviceProvider.Instance);
surface.LoadDevices(LogitechDeviceProvider.Instance);
surface.LoadDevices(CoolerMasterDeviceProvider.Instance);
surface.LoadDevices(NovationDeviceProvider.Instance);

After that you can access all loaded devices trough the Devices-enumerable on the surface.

Now the decisions depends more on how you want to work with the library. If you want to work surface-based you should loop through all devices and set their location to represent your table layout, if you want to work strictly device-based you can skip this step.

Lighting something up now is quite easy. Just create a group containing all the leds you want to use for one specific thing and apply a brush and if needed decorators (some sort of effects) to make something fancy. Just browse through the preset-projects to see what is currently available and how they are implemented (if you want to create your own).

You can also check https://github.com/DarthAffe/KeyboardAudioVisualizer/tree/master/KeyboardAudioVisualizer as an example project, but the device-access thing done there is not really good so it might not be the best reference :(

If you need any more information feel free to ask :)

@BrianLima

This comment has been minimized.

Copy link
Author

BrianLima commented Oct 17, 2017

This is exactly what i needed, thanks man!

I noticed that you are busy and there are many thing to make in the API yet, but i think that contributing is better than reinventing the wheel, if i face any bugs or need something implemented i'll talk to you and ask for directions for pull-requests.

Thanks, this library is shaping to be perfect to my Arduino LED project, loving it.

@BrianLima BrianLima closed this Oct 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment