Skip to content

Wooting dev portal

The resource guide for Wooting code

Wooting dev portal

  • Introduction developer portal
  • Analog SDK guide
    • Introduction
    • Analog API description
    • Basic example with Node
    • Advanced example with Node
    • Unity example
  • RGB SDK guide
    • Introduction
    • RGB API description
    • Basic example with Node
    • Advanced example with Node
  • Spotlight
Search

RGB API description

First posted: June 27, 2018December 5, 2018Filed under: Wooting RGB SDK Guide

bool wooting_rgb_kbd_connected(void);
returns true (1) if keyboard is found.

Note: This function offers a quick check if the keyboard is connected. It is recommended to poll this function at the start of your application and after a disconnect.


void wooting_rgb_set_disconnected_cb(void_cb cb);
cb - The function pointer of the callback

Note: The callback will be called when a Wooting keyboard disconnects. This will trigger after a failed color change.


bool wooting_rgb_reset(void);
returns true (1) if keyboard is reset

Note: This function will restore all the colours to the colours that were originally on the keyboard. This function must be called when you close the application.


bool wooting_rgb_direct_set_key(uint8_t row, uint8_t column, uint8_t red, uint8_t green, uint8_t blue);
returns true (1) if the colour is set.

row - horizontal index of the key
column - vertical index of the key
red - 0-255 value of the red color
green - 0-255 value of the green color
blue - 0-255 value of the blue color

Note: This function will directly change the color of 1 key on the keyboard. This will not influence the keyboard color array. Use this function for simple amplifications, like a notification. Use the array functions if you want to change the entire keyboard.


bool wooting_rgb_direct_reset_key(uint8_t row, uint8_t column);
returns true (1) if the colour is reset.

row - horizontal index of the key
column - vertical index of the key

Note: This function will directly reset the color of 1 key on the keyboard. This will not influence the keyboard color array. Use this function for simple amplifications, like a notification. Use the array functions if you want to change the entire keyboard.


bool wooting_rgb_array_update_keyboard(void);
returns true (1) if the colours are updated

Note: This function will send the changes made with the wooting_rgb_array single and full functions to the keyboard.


void wooting_rgb_array_auto_update(bool auto_update);
auto_update - auto update flag value

Note: This function can be used to set a auto update trigger after every change with the wooting_rgb_array single and full functions function. Standard is set to false.


bool wooting_rgb_array_set_single(uint8_t row, uint8_t column, uint8_t red, uint8_t green, uint8_t blue);
returns true (1) if the colours are changed (if auto update flag: updated).

Row - horizontal index of the key
column - vertical index of the key
red - 0-255 value of the red color
green - 0-255 value of the green color
blue - 0-255 value of the blue color

Note: This function will set a single color in the colour array. This will not directly update the keyboard (unless the flag is set), so it can be called frequently. For example in a loop that updates the entire keyboard. This way you can avoid dealing with C arrays from different languages.


bool wooting_rgb_array_set_full(const uint8_t *colors_buffer);
returns true (1) if the colours are changed (if auto update flag: updated).

colors_buffer - pointer to a buffer of a full color array

Note: This function will set a complete color array. This will not directly update the keyboard (unless the flag is set). If you use a non-C language it is recommended to use the wooting_rgb_array_set_single function to change the colors to avoid compatibility issues.

Buffer should be layed out as [Row0Col0Red, Row0Col0Green, Row0Col0Blue, Row0Col1Red, Row0Col1Green, Row0Col1Blue, ..., Row5Row20Red, Row5Row20Green, Row5Row20Blue].
Expected size is 6 row * 21 columns * 3 colors per key = 378 bytes.

Wooting RGB SDK Guide

Post navigation

Previous Post:

Basic example with Node

Next Post:

Introduction

About the Author

Erik Stakenborg

All posts byErik Stakenborg

Hide

Wooting RGB SDK Guide

  • Introduction
  • RGB API description
  • Basic example with Node
  • Advanced example with Node

SDK's

  • Guide analog SDK
  • Guide RGB SDK

Useful links

  • About us
  • Wooting blog
  • Wooting one
  • Wooting two
Visit Us On FacebookVisit Us On TwitterVisit Us On InstagramVisit Us On Youtube

Want to submit a creation you made using one of our API’s? Hop on over to our Discord and let us know what you made.

  • contest
  • Vote now!
  • Wooting dev portal